mailr18464 - /trunk/test_suite/system_tests/structure.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on February 13, 2013 - 16:41:
Author: bugman
Date: Wed Feb 13 16:41:21 2013
New Revision: 18464

URL: http://svn.gna.org/viewcvs/relax?rev=18464&view=rev
Log:
Created the Structure.test_load_spins_mol_cat system test.

This will be used to test a new 'mol_name_target' argument to the 
structure.load_spins user
function.


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=18464&r1=18463&r2=18464&view=diff
==============================================================================
--- trunk/test_suite/system_tests/structure.py (original)
+++ trunk/test_suite/system_tests/structure.py Wed Feb 13 16:41:21 2013
@@ -184,6 +184,33 @@
                         
self.assertAlmostEqual(cdp.structure.displacements._rotation_axis[models[i]][models[j]][k],
 rot_axis[i][j][k])
 
 
+    def test_load_spins_mol_cat(self):
+        """Test the loading of spins from different molecules into one 
molecule container."""
+
+        # Path of the files.
+        path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'structures'+sep+'lactose'
+
+        # Read the PDBs.
+        self.interpreter.structure.read_pdb(file='lactose_MCMM4_S1_1.pdb', 
dir=path, set_mol_name='L1', parser='internal')
+        self.interpreter.structure.read_pdb(file='lactose_MCMM4_S1_2.pdb', 
dir=path, set_mol_name='L2', parser='internal')
+
+        # Load a few protons.
+        self.interpreter.structure.load_spins('#L1:900@C1', 
mol_name_target='Lactose')
+        self.interpreter.structure.load_spins('#L2:900@C2', 
mol_name_target='Lactose')
+
+        # Check the spin data.
+        self.assertEqual(len(cdp.mol), 1)
+        self.assertEqual(cdp.mol[0].name, 'Lactose')
+        self.assertEqual(len(cdp.mol[0].res), 1)
+        self.assertEqual(cdp.mol[0].res[0].name, 'UNK')
+        self.assertEqual(cdp.mol[0].res[0].num, 900)
+        self.assertEqual(len(cdp.mol[0].res[0].spin), 2)
+        self.assertEqual(cdp.mol[0].res[0].spin[0].name, 'C1')
+        self.assertEqual(cdp.mol[0].res[0].spin[0].num, 1)
+        self.assertEqual(cdp.mol[0].res[0].spin[1].name, 'C2')
+        self.assertEqual(cdp.mol[0].res[0].spin[1].num, 2)
+
+
     def test_load_internal_results(self):
         """Load the PDB file using the information in a results file (using 
the internal structural object)."""
 




Related Messages


Powered by MHonArc, Updated Wed Feb 13 17:00:02 2013