mailr23496 - /trunk/test_suite/gui_tests/test_user_functions.py


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

Header


Content

Posted by edward on May 28, 2014 - 11:26:
Author: bugman
Date: Wed May 28 11:26:48 2014
New Revision: 23496

URL: http://svn.gna.org/viewcvs/relax?rev=23496&view=rev
Log:
Created the User_functions.test_structure_rotate GUI tests.

This is to catch bug #22100 (https://gna.org/bugs/?22100), the rotation 
argument for the
structure.rotate user function cannot be changed in the GUI, as an 
AttributeError is raised.


Modified:
    trunk/test_suite/gui_tests/test_user_functions.py

Modified: trunk/test_suite/gui_tests/test_user_functions.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/gui_tests/test_user_functions.py?rev=23496&r1=23495&r2=23496&view=diff
==============================================================================
--- trunk/test_suite/gui_tests/test_user_functions.py   (original)
+++ trunk/test_suite/gui_tests/test_user_functions.py   Wed May 28 11:26:48 
2014
@@ -87,6 +87,64 @@
         self.assertEqual(cdp.structure.structural_data[1].num, 3)
 
 
+    def test_structure_rotate(self):
+        """Test the operation of the structure.rotate user function GUI 
window."""
+
+        # Open the pipe.create user function window, set the args and 
execute.
+        uf = uf_store['pipe.create']
+        uf._sync = True
+        uf.create_wizard(parent=self.app.gui)
+        uf.page.SetValue('pipe_name', str_to_gui('PDB rotation test'))
+        uf.page.SetValue('pipe_type', str_to_gui('mf'))
+        uf.wizard._go_next(None)
+
+        # Open the structure.read_pdb user function window.
+        uf = uf_store['structure.read_pdb']
+        uf._sync = True
+        uf.create_wizard(parent=self.app.gui)
+
+        # The PDB file to operate on.
+        file = status.install_path + sep + 'test_suite' + sep + 
'shared_data' + sep + 'structures' + sep + 'trunc_ubi_pcs.pdb'
+        uf.page.SetValue('file', str_to_gui(file))
+
+        # Set the models to read.
+        uf.page.SetValue('read_model', str_to_gui('6'))
+        uf.page.uf_args['read_model'].selection_win_show()
+        uf.page.uf_args['read_model'].sel_win.add_element(None)
+        
uf.page.uf_args['read_model'].sel_win.sequence.SetStringItem(index=0, col=1, 
label=int_to_gui(2))
+        
uf.page.uf_args['read_model'].sel_win.sequence.SetStringItem(index=1, col=1, 
label=int_to_gui(4))
+        uf.page.uf_args['read_model'].selection_win_data()
+
+        # Renumber the models.
+        uf.page.uf_args['set_model_num'].selection_win_show()
+        uf.page.uf_args['set_model_num'].sel_win.add_element(None)
+        
uf.page.uf_args['set_model_num'].sel_win.sequence.SetStringItem(index=0, 
col=1, label=int_to_gui(1))
+        
uf.page.uf_args['set_model_num'].sel_win.sequence.SetStringItem(index=1, 
col=1, label=int_to_gui(3))
+        uf.page.uf_args['set_model_num'].selection_win_data()
+
+        # GUI data checks.
+        self.assertEqual(uf.page.uf_args['read_model'].GetValue(), [2, 4])
+        self.assertEqual(uf.page.uf_args['set_model_num'].GetValue(), [1, 3])
+
+        # Execute the user function.
+        uf.wizard._go_next(None)
+
+        # Open the structure.rotate user function window.
+        uf = uf_store['structure.rotate']
+        uf._sync = True
+        uf.create_wizard(parent=self.app.gui)
+
+        # Change the rotation matrix without changing anything.
+        uf.page.uf_args['R'].open_dialog(None)
+
+        # Check the structural data.
+        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, 3)
+
+
     def test_value_set(self):
         """Test the full operation of the value.set user function GUI 
window."""
 




Related Messages


Powered by MHonArc, Updated Wed May 28 11:40:02 2014