diff --git a/modules/atom/test/test_create_protein.py b/modules/atom/test/test_create_protein.py index 69dc0e3015..389f095adc 100644 --- a/modules/atom/test/test_create_protein.py +++ b/modules/atom/test/test_create_protein.py @@ -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()