mailr18503 - /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 19, 2013 - 21:33:
Author: bugman
Date: Tue Feb 19 21:33:59 2013
New Revision: 18503

URL: http://svn.gna.org/viewcvs/relax?rev=18503&view=rev
Log:
Created the Structure.test_read_pdb_1UBQ to check the complete parsing of the 
complex PDB file.

The test is currently quite basic and needs to check more of the internal 
structural object.


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=18503&r1=18502&r2=18503&view=diff
==============================================================================
--- trunk/test_suite/system_tests/structure.py (original)
+++ trunk/test_suite/system_tests/structure.py Tue Feb 19 21:33:59 2013
@@ -377,7 +377,6 @@
         self.assert_(hasattr(cdp.interatomic[0], 'vector'))
 
 
-
     def test_read_pdb_internal2(self):
         """Load the 'Ap4Aase_res1-12.pdb' PDB file (using the internal 
structural object PDB reader)."""
 
@@ -822,6 +821,32 @@
                 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_pdb_1UBQ(self):
+        """Test the reading of the complete 1UBQ PDB file."""
+
+        # Load the file.
+        path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'structures'
+        self.interpreter.structure.read_pdb('1UBQ.pdb', dir=path)
+
+        # Check the data.
+        self.assert_(hasattr(cdp, 'structure'))
+        self.assert_(hasattr(cdp.structure, 'structural_data'))
+        self.assertEqual(len(cdp.structure.structural_data), 1)
+        self.assertEqual(len(cdp.structure.structural_data[0].mol), 1)
+
+        # Check the first atom.
+        
self.assertEqual(cdp.structure.structural_data[0].mol[0].atom_num[0], 1)
+        self.assertEqual(cdp.structure.structural_data[0].mol[0].x[0], 
27.340)
+        self.assertEqual(cdp.structure.structural_data[0].mol[0].y[0], 
24.430)
+        self.assertEqual(cdp.structure.structural_data[0].mol[0].z[0], 2.614)
+
+        # Check the last atom.
+        
self.assertEqual(cdp.structure.structural_data[0].mol[0].atom_num[-1], 602)
+        self.assertEqual(cdp.structure.structural_data[0].mol[0].x[-1], 
40.862)
+        self.assertEqual(cdp.structure.structural_data[0].mol[0].y[-1], 
39.575)
+        self.assertEqual(cdp.structure.structural_data[0].mol[0].z[-1], 
36.251)
 
 
     def test_read_xyz_internal1(self):




Related Messages


Powered by MHonArc, Updated Tue Feb 19 22:00:02 2013