1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 from os import F_OK, access, sep
25 import wx
26
27
28 from data import Relax_data_store; ds = Relax_data_store()
29 from generic_fns.mol_res_spin import spin_loop
30 from generic_fns.pipes import cdp_name
31 from status import Status; status = Status()
32 from test_suite.gui_tests.base_classes import GuiTestCase
33
34
35 from gui.string_conv import int_to_gui, str_to_gui
36 from gui.wizard import Wiz_window
37
38
40 """Class for testing various aspects specific to saved states."""
41
43 """Test the loading of an old relax 1.3 save state with GUI information."""
44
45
46 file = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'saved_states' + sep + 'gui_analyses_1.3.bz2'
47 self.app.gui.state_load(file_name=file)
48
49
51 """Test the loading of a relax save state with no GUI data."""
52
53
54 file = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'model_free' + sep + 'OMP' + sep + 'final_results_trunc_1.3_v2'
55 self.app.gui.state_load(file_name=file)
56
57
58 self.app.gui.show_pipe_editor(None)
59
60
61 self.app.gui.pipe_editor.menu(Fake_grid_cell_right_click())
62
63
64 self.app.gui.pipe_editor.associate_auto(None)
65
66
67 index = 0
68
69
70 self.assert_(not self.app.gui.analysis.init_state)
71 self.assertEqual(self.app.gui.analysis._num_analyses, 1)
72 self.assertEqual(len(self.app.gui.analysis._analyses), 1)
73 self.assertEqual(self.app.gui.analysis.notebook.GetPageCount(), 1)
74 self.assert_(self.app.gui.analysis._analyses[index].init_flag)
75
76
77 self.assert_(hasattr(ds, 'relax_gui'))
78 self.assertEqual(ds.relax_gui.analyses[index].analysis_name, 'Model-free')
79 self.assertEqual(ds.relax_gui.analyses[index].pipe_name, 'a')
80
81
82
84 """Simulate a grid_cell_right_click event ."""
85
87 """Overwrite the GetRow() method."""
88
89
90 return 0
91