Author: bugman Date: Wed May 28 17:40:37 2014 New Revision: 23540 URL: http://svn.gna.org/viewcvs/relax?rev=23540&view=rev Log: Merged revisions 23521 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r23521 | bugman | 2014-05-28 16:32:01 +0200 (Wed, 28 May 2014) | 7 lines Created the User_functions.test_dx_map GUI test. This extensively checks the 'point' argument for the dx.map user function GUI window. This is to catch bug #22102 (https://gna.org/bugs/?22102), the point argument of the dx.map user function being incorrect in the GUI. ........ 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 17:40:37 2014 @@ -1 +1 @@ -/trunk:1-23493,23495-23500,23505-23520 +/trunk:1-23493,23495-23500,23505-23521 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=23540&r1=23539&r2=23540&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 17:40:37 2014 @@ -57,6 +57,59 @@ # Execute. uf.wizard._go_next(None) + + + def test_dx_map(self): + """Test the operation of the dx.map user function GUI window.""" + + # Open the dx.map user function window. + uf = uf_store['dx.map'] + uf._sync = True + uf.create_wizard(parent=self.app.gui) + + # Set the y-value of a single point, and check. + uf.page.uf_args['point'].selection_win_show() + uf.page.uf_args['point'].sel_win.sequence.SetStringItem(index=0, col=2, label=int_to_gui(2)) + uf.page.uf_args['point'].selection_win_data() + points = uf.page.uf_args['point'].GetValue() + print("Points: %s" % points) + self.assertEqual(len(points), 1) + self.assertEqual(len(points[0]), 3) + self.assertEqual(points[0][0], None) + self.assertEqual(points[0][1], 2.0) + self.assertEqual(points[0][2], None) + + # Set the point to nothing in the wizard, open the Sequence_2D window, close the window, and check that None comes back. + uf.page.uf_args['point'].SetValue(str_to_gui('')) + uf.page.uf_args['point'].selection_win_show() + uf.page.uf_args['point'].selection_win_data() + points = uf.page.uf_args['point'].GetValue() + print("Points: %s" % points) + self.assertEqual(points, None) + + # Set the points to a number of invalid values, checking that they are ignored. + for val in ['2', 'die', '[1, 2, 3]', '[1]', '[[1, 2, 3], 1, 2, 3], [1, 2, 3]]']: + uf.page.uf_args['point'].SetValue(str_to_gui(val)) + uf.page.uf_args['point'].selection_win_show() + uf.page.uf_args['point'].selection_win_data() + points = uf.page.uf_args['point'].GetValue() + print("Points: %s" % points) + self.assertEqual(points, None) + + # Set the Sequence_2D elements to invalid values. + for val in ['x']: + uf.page.uf_args['point'].SetValue(str_to_gui('')) + uf.page.uf_args['point'].selection_win_show() + uf.page.uf_args['point'].sel_win.sequence.SetStringItem(index=0, col=2, label=str_to_gui(val)) + uf.page.uf_args['point'].sel_win.sequence.SetStringItem(index=0, col=1, label=int_to_gui(1)) + uf.page.uf_args['point'].selection_win_data() + points = uf.page.uf_args['point'].GetValue() + print("Points: %s" % points) + self.assertEqual(len(points), 1) + self.assertEqual(len(points[0]), 3) + self.assertEqual(points[0][0], 1.0) + self.assertEqual(points[0][1], None) + self.assertEqual(points[0][2], None) def test_structure_pdb_read(self):