Trees | Indices | Help |
|
---|
|
1 ############################################################################### 2 # # 3 # Copyright (C) 2014-2015 Edward d'Auvergne # 4 # # 5 # This file is part of the program relax (http://www.nmr-relax.com). # 6 # # 7 # This program is free software: you can redistribute it and/or modify # 8 # it under the terms of the GNU General Public License as published by # 9 # the Free Software Foundation, either version 3 of the License, or # 10 # (at your option) any later version. # 11 # # 12 # This program is distributed in the hope that it will be useful, # 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of # 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 15 # GNU General Public License for more details. # 16 # # 17 # You should have received a copy of the GNU General Public License # 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. # 19 # # 20 ############################################################################### 21 22 # Module docstring. 23 """Generic GUI tests.""" 24 25 # Python module imports. 26 import wx 27 28 # relax module imports. 29 from pipe_control.pipes import cdp_name 30 from status import Status; status = Status() 31 from test_suite.gui_tests.base_classes import GuiTestCase 32 33 # relax GUI imports. 34 from gui.interpreter import Interpreter; interpreter = Interpreter() 35 from gui.string_conv import str_to_gui 36 3739 """Class for testing general GUI operations.""" 4011642 """Set up the test case class for the system tests.""" 43 44 # Execute the base __init__ methods. 45 super(General, self).__init__(methodName) 46 47 # Tests to skip. 48 blacklist = [ 49 'test_new_analysis_wizard_memory_leak' 50 ] 51 52 # Skip the blacklisted tests. 53 if methodName in blacklist: 54 status.skipped_tests.append([methodName, None, self._skip_type])55 5658 """Catch U{bug #20479<https://web.archive.org/web/https://gna.org/bugs/?20479>}, the failure to switch pipes when closing non-last tabs.""" 59 60 # NOE tab: Simulate the new analysis wizard. 61 analysis = self.new_analysis_wizard(analysis_type='noe', analysis_name='NOE test', pipe_name='noe', pipe_bundle='noe bundle') 62 63 # Mf tab: Simulate the new analysis wizard. 64 analysis = self.new_analysis_wizard(analysis_type='mf', analysis_name='Mf test', pipe_name='mf', pipe_bundle='mf bundle') 65 66 # NOE tab: Switch back. 67 self.app.gui.analysis.switch_page(index=0) 68 69 # NOE tab: Closure. 70 self.app.gui.analysis.delete_analysis(0) 71 72 # Check that the Mf data pipe is now the current pipe. 73 self.assertEqual(cdp_name(), 'mf')74 7577 """Catch U{bug #23187<https://web.archive.org/web/https://gna.org/bugs/?23187>}, deleting residue in GUI, and then open spin viewer crashes relax.""" 78 79 # Mf tab: Simulate the new analysis wizard. 80 analysis = self.new_analysis_wizard(analysis_type='mf', analysis_name='Mf test', pipe_name='mf', pipe_bundle='mf bundle') 81 82 # Create some residues. 83 self._execute_uf(uf_name='residue.create', res_num=1) 84 self._execute_uf(uf_name='residue.create', res_num=2) 85 interpreter.flush() # Required because of the asynchronous uf call. 86 87 # Launch the spin viewer window. 88 self.app.gui.show_tree() 89 90 # Close the spin viewer window. 91 self.app.gui.spin_viewer.handler_close() 92 93 # Delete residue 2. 94 self._execute_uf(uf_name='residue.delete', res_id=":2") 95 interpreter.flush() # Required because of the asynchronous uf call. 96 97 # Launch the spin viewer window. 98 self.app.gui.show_tree()99 100102 """Test for memory leaks in the new analysis wizard.""" 103 104 # A large loop (to try to reach the USER Object limit in MS Windows). 105 for i in range(100): 106 # Printout for debugging. 107 print("Analysis wizard number %i." % (i+1)) 108 109 # Simulate the menu selection, but don't destroy the GUI element. 110 self.app.gui.analysis.menu_new(None, destroy=False) 111 112 # Wizard cleanup. 113 wx.Yield() 114 self.app.gui.analysis.new_wizard.Destroy() 115 del self.app.gui.analysis.new_wizard
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Sep 30 14:41:47 2015 | http://epydoc.sourceforge.net |