mailr23573 - in /branches/frame_order_cleanup: ./ 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 - 20:31:
Author: bugman
Date: Wed May 28 20:31:21 2014
New Revision: 23573

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

........
  r23571 | bugman | 2014-05-28 20:25:54 +0200 (Wed, 28 May 2014) | 8 lines
  
  Created the User_functions.test_spectrum_read_intensities GUI test to catch 
bug #22105.
  
  This is reported at https://gna.org/bugs/?22105.
  
  The problem is that a single file name is split up into many files when the 
file selection button
  is clicked, one for each character of the file name.
........

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 20:31:21 2014
@@ -1 +1 @@
-/trunk:1-23569
+/trunk:1-23571

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=23573&r1=23572&r2=23573&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 20:31:21 2014
@@ -142,6 +142,53 @@
             self.assertEqual(points[0][0], 1.0)
             self.assertEqual(points[0][1], None)
             self.assertEqual(points[0][2], None)
+
+
+    def test_spectrum_read_intensities(self):
+        """Test the operation of the spectrum.read_intensities user function 
GUI window."""
+
+        # Open the spectrum.read_intensities user function window.
+        uf = uf_store['spectrum.read_intensities']
+        uf._sync = True
+        uf.create_wizard(parent=self.app.gui)
+
+        # Set the y-value of a single pos, and check.
+        uf.page.uf_args['file'].selection_win_show()
+        uf.page.uf_args['file'].sel_win.SetValue('test_file')
+        uf.page.uf_args['file'].selection_win_data()
+        file = uf.page.uf_args['file'].GetValue()
+        print("File names:  %s" % file)
+        self.assert_(isinstance(file, str))
+        self.assertEqual(file, 'test_file')
+
+        # Set the file to nothing in the wizard, open the Sequence window, 
close the window, and check that None comes back.
+        uf.page.uf_args['file'].SetValue(str_to_gui(''))
+        uf.page.uf_args['file'].selection_win_show()
+        uf.page.uf_args['file'].selection_win_data()
+        file = uf.page.uf_args['file'].GetValue()
+        print("File names:  %s" % file)
+        self.assertEqual(file, None)
+
+        # Set a valid file list in the wizard, open and close the Sequence 
window (twice), and check that the file comes back.
+        uf.page.uf_args['file'].SetValue(str_to_gui("['test1', 'test2']"))
+        uf.page.uf_args['file'].selection_win_show()
+        uf.page.uf_args['file'].selection_win_data()
+        uf.page.uf_args['file'].selection_win_show()
+        uf.page.uf_args['file'].selection_win_data()
+        file = uf.page.uf_args['file'].GetValue()
+        print("File names:  %s" % file)
+        self.assertEqual(len(file), 2)
+        self.assertEqual(file[0], 'test1')
+        self.assertEqual(file[1], 'test2')
+
+        # Set the file to a number of invalid values, checking that they are 
ignored.
+        for val in ["['1', '2', '3'", "['1'", "[['1'], ['2'], ['1', '2', 
'3']]"]:
+            uf.page.uf_args['file'].SetValue(str_to_gui(val))
+            uf.page.uf_args['file'].selection_win_show()
+            uf.page.uf_args['file'].selection_win_data()
+            file = uf.page.uf_args['file'].GetValue()
+            print("Invalid file: %s\nFile names:  %s" % (val, file))
+            self.assertEqual(file, None)
 
 
     def test_structure_add_atom(self):




Related Messages


Powered by MHonArc, Updated Wed May 28 20:40:03 2014