Author: bugman
Date: Fri Sep 12 10:45:48 2014
New Revision: 25770
URL: http://svn.gna.org/viewcvs/relax?rev=25770&view=rev
Log:
Created the Structure.test_delete_model system test.
This is in preparation for extending the structure.delete user function to be
able to delete
individual structural models. The test will only pass once this functionality
is in place.
Modified:
trunk/test_suite/system_tests/structure.py
Modified: trunk/test_suite/system_tests/structure.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/structure.py?rev=25770&r1=25769&r2=25770&view=diff
==============================================================================
--- trunk/test_suite/system_tests/structure.py (original)
+++ trunk/test_suite/system_tests/structure.py Fri Sep 12 10:45:48 2014
@@ -2430,6 +2430,33 @@
self.interpreter.structure.delete()
+ def test_delete_model(self):
+ """Test the deletion of a single structural model."""
+
+ # Path of the structure file.
+ path = status.install_path +
sep+'test_suite'+sep+'shared_data'+sep+'structures'
+
+ # Load the file as two models.
+ self.interpreter.structure.read_pdb('Ap4Aase_res1-12.pdb', dir=path,
set_model_num=1)
+ self.interpreter.structure.read_pdb('Ap4Aase_res1-12.pdb', dir=path,
set_model_num=2)
+
+ # Test the structure metadata.
+ self.assert_(hasattr(cdp, 'structure'))
+ self.assert_(hasattr(cdp.structure, 'structural_data'))
+ self.assertEqual(len(cdp.structure.structural_data), 2)
+ self.assertEqual(cdp.structure.structural_data[0].num, 1)
+ self.assertEqual(cdp.structure.structural_data[1].num, 2)
+
+ # Delete model 1.
+ self.interpreter.structure.delete(model=1)
+
+ # Test the structure metadata.
+ self.assert_(hasattr(cdp, 'structure'))
+ self.assert_(hasattr(cdp.structure, 'structural_data'))
+ self.assertEqual(len(cdp.structure.structural_data), 1)
+ self.assertEqual(cdp.structure.structural_data[0].num, 2)
+
+
def test_delete_multi_pipe(self):
"""Test the deletion of structural data in only one pipe."""
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits