Skip to content

Commit

Permalink
Make test actually test something
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Nov 8, 2023
1 parent b944cb4 commit c575056
Showing 1 changed file with 4 additions and 30 deletions.
34 changes: 4 additions & 30 deletions modules/atom/test/test_create_protein.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,16 @@
from __future__ import print_function
import IMP
import IMP.test
import IMP.core
import IMP.atom
import IMP.display
from IMP.algebra import *


class Tests(IMP.test.TestCase):

"""Test molecular dynamics optimizer"""

def _broken_until_swig_hierarchies_gets_fixed_test_cp(self):
def test_cp(self):
"""Testing create_protein"""
m = IMP.Model()
rp = IMP.Particle(m)
r = IMP.atom.create_protein(rp, "hi", 10.0, 150)
print("back")
r.show()
m.add_restraint(r)
p = IMP.atom.Hierarchy(rp)
print("printing")
print(p.get_number_of_children())
print(p.get_children())
print(p.get_children().size())
for c in p.get_children():
d = IMP.core.XYZ(c.get_particle())
d.set_coordinates(get_random_vector_in(Vector3D(0, 0, 0),
Vector3D(300, 300, 300)))
o = IMP.core.SteepestDescent()
o.set_model(m)
score = o.optimize(1000)
print(score)
w = IMP.display.ChimeraWriter(self.get_tmp_file_name("proteinconf.py"))
for c in p.get_children():
d = IMP.core.XYZR(c.get_particle())
w.add_geometry(IMP.core.XYZRGeometry(d))
self.assertLess(score, 1)
p = IMP.atom.create_protein(m, "hi", 10.0, 150)
self.assertEqual(len(p.get_children()), 7)


if __name__ == '__main__':
IMP.test.main()

0 comments on commit c575056

Please sign in to comment.