Author: bugman Date: Wed May 28 16:34:59 2014 New Revision: 23523 URL: http://svn.gna.org/viewcvs/relax?rev=23523&view=rev Log: Merged revisions 23496 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r23496 | bugman | 2014-05-28 11:26:48 +0200 (Wed, 28 May 2014) | 6 lines 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: branches/frame_order_cleanup/ (props changed) branches/frame_order_cleanup/test_suite/gui_tests/test_user_functions.py Propchange: branches/frame_order_cleanup/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Wed May 28 16:34:59 2014 @@ -1 +1 @@ -/trunk:1-23493,23495 +/trunk:1-23493,23495-23496 Modified: branches/frame_order_cleanup/test_suite/gui_tests/test_user_functions.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/test_suite/gui_tests/test_user_functions.py?rev=23523&r1=23522&r2=23523&view=diff ============================================================================== --- branches/frame_order_cleanup/test_suite/gui_tests/test_user_functions.py (original) +++ branches/frame_order_cleanup/test_suite/gui_tests/test_user_functions.py Wed May 28 16:34:59 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."""