Author: bugman Date: Fri Sep 6 09:47:27 2013 New Revision: 20866 URL: http://svn.gna.org/viewcvs/relax?rev=20866&view=rev Log: Expanded the Relax_disp.test_hansen_trunc_data GUI test to check the spectrum list GUI element. The popup menu is now tested with the Fake_right_click() trick. And the actions of a number of the menu items, the action*() methods, are tested to see if the user functions are correctly called. Modified: branches/relax_disp/test_suite/gui_tests/relax_disp.py Modified: branches/relax_disp/test_suite/gui_tests/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/gui_tests/relax_disp.py?rev=20866&r1=20865&r2=20866&view=diff ============================================================================== --- branches/relax_disp/test_suite/gui_tests/relax_disp.py (original) +++ branches/relax_disp/test_suite/gui_tests/relax_disp.py Fri Sep 6 09:47:27 2013 @@ -276,6 +276,26 @@ wizard._apply(None) wizard._skip(None) + # Flush all wx events (to allow the spectrum list GUI element to populate all its rows). + wx.Yield() + + # Simulate right clicking in the spectrum list element to test the popup menu. + analysis.peak_intensity.on_right_click(Fake_right_click()) + + # Simulate the popup menu entries to catch bugs there (just apply the user functions with the currently set values). + analysis.peak_intensity.action_relax_disp_cpmg_frq(item=4) + uf_store['relax_disp.cpmg_frq'].wizard._go_next() + interpreter.flush() + analysis.peak_intensity.action_relax_disp_exp_type(item=5) + uf_store['relax_disp.exp_type'].wizard._go_next() + interpreter.flush() + analysis.peak_intensity.action_relax_disp_relax_time(item=0) + uf_store['relax_disp.relax_time'].wizard._go_next() + interpreter.flush() + analysis.peak_intensity.action_spectrometer_frq(item=10) + uf_store['spectrometer.frequency'].wizard._go_next() + interpreter.flush() + # Set up the models to use. models = [MODEL_R2EFF, MODEL_NOREX, MODEL_LM63, MODEL_CR72, MODEL_IT99, MODEL_NS_CPMG_2SITE_EXPANDED] for i in range(len(analysis.model_field.models)): @@ -489,3 +509,14 @@ # Increment the spin index. spin_index += 1 + + + +class Fake_right_click: + """Simulate a grid_cell_right_click event .""" + + def GetPosition(self): + """Overwrite the GetPosition() method.""" + + # Return roughly the position of the forth row. + return (10, 65)