mailr22035 - in /branches/double_rotor: ./ 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 January 21, 2014 - 10:31:
Author: bugman
Date: Tue Jan 21 10:31:30 2014
New Revision: 22035

URL: http://svn.gna.org/viewcvs/relax?rev=22035&view=rev
Log:
Merged revisions 22031 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r22031 | bugman | 2014-01-21 10:15:22 +0100 (Tue, 21 Jan 2014) | 11 lines
  
  Created the Structure.test_bug_21522_master_record_atom_count system test.
  
  This is designed to catch bug #21522 (https://gna.org/bugs/?21522), the 
structure.write_pdb user
  function creating an incorrect MASTER record.  This hence also catches bug 
#21520
  (https://gna.org/bugs/?21520), the failure of the structure.write_pdb user 
function when creating
  the MASTER record due to too many ATOM and HETATM records being present.
  
  The test simply creates to structural models, adds one atom, and writes out 
a PDB file, checking its
  contents.
........

Modified:
    branches/double_rotor/   (props changed)
    branches/double_rotor/test_suite/system_tests/structure.py

Propchange: branches/double_rotor/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jan 21 10:31:30 2014
@@ -1,1 +1,1 @@
-/trunk:1-22029
+/trunk:1-22029,22031

Modified: branches/double_rotor/test_suite/system_tests/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/double_rotor/test_suite/system_tests/structure.py?rev=22035&r1=22034&r2=22035&view=diff
==============================================================================
--- branches/double_rotor/test_suite/system_tests/structure.py (original)
+++ branches/double_rotor/test_suite/system_tests/structure.py Tue Jan 21 
10:31:30 2014
@@ -93,6 +93,45 @@
 
         # Load the :60@HE1 spin - this clashes with the :60@H spin as both 
have the spin ID of ':60@0'.
         self.interpreter.structure.load_spins(spin_id='@HE1', ave_pos=True)
+
+
+    def test_bug_21522_master_record_atom_count(self):
+        """Catch U{bug #21522<https://gna.org/bugs/?21522>}, the 
structure.write_pdb user function creating an incorrect MASTER record.
+
+        This also triggers bug #21520<https://gna.org/bugs/?21520>}, the 
failure of the structure.write_pdb user function when creating the MASTER 
record due to too many ATOM and HETATM records being present.
+        """
+
+        # Create 2 models.
+        self.interpreter.structure.add_model(model_num=1)
+        self.interpreter.structure.add_model(model_num=2)
+
+        # Add a single atom.
+        self.interpreter.structure.add_atom(atom_name='N', res_name='Pro', 
res_num=2, pos=[1., 2., 3.], element='N')
+
+        # Create a PDB file.
+        file = DummyFileObject()
+        self.interpreter.structure.write_pdb(file=file, force=True)
+
+        # The file contents, as they should be.
+        contents = [
+            "REMARK   4 THIS FILE COMPLIES WITH FORMAT V. 3.30, JUL-2011.    
                \n",
+            "REMARK  40 CREATED BY RELAX (HTTP://WWW.NMR-RELAX.COM).         
                \n",
+            "MODEL        1                                                  
                \n",
+            "ATOM      1  N   Pro     2       1.000   2.000   3.000  1.00  
0.00           N  \n",
+            "TER       2      Pro     2                                      
                \n",
+            "ENDMDL                                                          
                \n",
+            "MODEL        2                                                  
                \n",
+            "ATOM      1  N   Pro     2       1.000   2.000   3.000  1.00  
0.00           N  \n",
+            "TER       2      Pro     2                                      
                \n",
+            "ENDMDL                                                          
                \n",
+            "MASTER        0    0    0    0    0    0    0    0    1    1    
0    0          \n",
+            "END                                                             
                \n"
+        ]
+
+        # Check the created PDB file.
+        lines = file.readlines()
+        for i in range(len(lines)):
+            self.assertEqual(result[i], lines[i])
 
 
     def test_delete_empty(self):




Related Messages


Powered by MHonArc, Updated Tue Jan 21 10:40:02 2014