mailr12942 - /branches/xyz/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 June 09, 2011 - 18:49:
Author: bugman
Date: Thu Jun  9 18:49:18 2011
New Revision: 12942

URL: http://svn.gna.org/viewcvs/relax?rev=12942&view=rev
Log:
Creation of a new system test test_read_xyz_internal1().

This is Han's patch http://gna.org/task/download.php?file_id=13143 attached 
to the task
http://gna.org/task/?7404.

In order to create a system test for reading the xyz file, a new function
'test_read_xyz_internal1()' has been generated in the 
xyz/test_suite/system_tests/structure.py. It
is based on the function 'test_read_pdb_internal1()'.


Modified:
    branches/xyz/test_suite/system_tests/structure.py

Modified: branches/xyz/test_suite/system_tests/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/xyz/test_suite/system_tests/structure.py?rev=12942&r1=12941&r2=12942&view=diff
==============================================================================
--- branches/xyz/test_suite/system_tests/structure.py (original)
+++ branches/xyz/test_suite/system_tests/structure.py Thu Jun  9 18:49:18 2011
@@ -624,3 +624,31 @@
                 self.assertEqual(mol.file_path, paths[i][j])
                 self.assertEqual(mol.file_model, models[i][j])
                 self.assertEqual(mol.file_mol_num, 1)
+
+
+    def test_read_xyz_internal1(self):
+        """Load the 'Indol_test.xyz' XYZ file (using the internal structural 
object XYZ reader)."""
+
+        # Path of the files.
+        path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'structures'
+
+        # Read the PDB.
+        self.interpreter.structure.read_pdb(file='Indol_test.xyz', dir=path, 
parser='internal')
+
+        # Test the molecule name.
+        self.assertEqual(cdp.structure.structural_data[0].mol[0].mol_name, 
'1F35_N_H_molmol_mol1')
+
+        # Load a single atom and test it.
+        self.interpreter.structure.load_spins('#1F35_N_H_molmol_mol1:3@N')
+        self.assertEqual(count_spins(), 1)
+
+        # Try loading a few protons.
+        self.interpreter.structure.load_spins('@*H*')
+
+        # And now all the rest of the atoms.
+        self.interpreter.structure.load_spins()
+
+        # Extract a N-Ca vector.
+        self.interpreter.structure.vectors('CA', 
spin_id='#1F35_N_H_molmol_mol1:3@N')
+        print((cdp.mol[0].res[0].spin[0]))
+        self.assert_(hasattr(cdp.mol[0].res[0].spin[0], 'bond_vect'))




Related Messages


Powered by MHonArc, Updated Thu Jun 09 19:20:02 2011