1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """GUI tests for the Bruker Dynamics Center support."""
24
25
26 from os import sep
27
28
29 from data_store import Relax_data_store; ds = Relax_data_store()
30 from pipe_control.mol_res_spin import spin_loop
31 from status import Status; status = Status()
32 from test_suite.gui_tests.base_classes import GuiTestCase
33 from test_suite import system_tests
34
35
36 from gui.interpreter import Interpreter; interpreter = Interpreter()
37 from gui.string_conv import str_to_gui
38
39
40 -class Bruker(GuiTestCase, system_tests.bruker.Bruker):
41 """Class for testing the Bruker Dynamics Center support in the GUI."""
42
44 """Set up the test case class for the system tests."""
45
46
47 GuiTestCase.__init__(self, methodName)
48
49
58
59
61 """Test the reading of a DC file, catching U{bug #20152<https://web.archive.org/web/https://gna.org/bugs/?20152>}."""
62
63
64 self.app.gui.analysis.menu_new(None)
65 page = self.app.gui.analysis.new_wizard.wizard.get_page(0)
66 page.select_mf(None)
67 page.analysis_name.SetValue(str_to_gui("Model-free test"))
68 self.app.gui.analysis.new_wizard.wizard._go_next(None)
69 page = self.app.gui.analysis.new_wizard.wizard.get_page(1)
70 self.app.gui.analysis.new_wizard.wizard._go_next(None)
71
72
73 analysis_type, analysis_name, pipe_name, pipe_bundle, uf_exec = self.app.gui.analysis.new_wizard.get_data()
74
75
76 self.app.gui.analysis.new_analysis(analysis_type=analysis_type, analysis_name=analysis_name, pipe_name=pipe_name, pipe_bundle=pipe_bundle)
77
78
79 analysis = self.app.gui.analysis.get_page_from_name("Model-free test")
80
81
82 analysis.field_results_dir.SetValue(str_to_gui(ds.tmpdir))
83
84
85 self.app.gui.show_tree()
86
87
88 self.app.gui.spin_viewer.load_spins_wizard()
89
90
91 page = self.app.gui.spin_viewer.wizard.get_page(0)
92 page.selection = 'new pdb'
93 self.app.gui.spin_viewer.wizard._go_next()
94 page = self.app.gui.spin_viewer.wizard.get_page(self.app.gui.spin_viewer.wizard._current_page)
95 page.uf_args['file'].SetValue(str_to_gui(status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'structures' + sep + '1UBQ_H_trunc.pdb'))
96 self.app.gui.spin_viewer.wizard._go_next()
97 interpreter.flush()
98
99
100 self.app.gui.spin_viewer.wizard._go_next()
101 interpreter.flush()
102
103
104 self.app.gui.spin_viewer.handler_close()
105
106
107 interpreter.flush()
108
109
110 data_path = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'model_free' + sep + 'sphere' + sep
111
112
113 analysis.relax_data.wizard_bruker(None)
114
115
116 page = analysis.relax_data.wizard.get_page(analysis.relax_data.page_indices['read'])
117 page.uf_args['ri_id'].SetValue(str_to_gui('r1_700'))
118 page.uf_args['file'].SetValue(str_to_gui(status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'bruker_files' + sep + 'T1_demo_1UBQ_H_trunc.txt'))
119
120
121 analysis.relax_data.wizard._go_next(None)
122
123
124 self.assert_(not hasattr(cdp, 'ri_ids'))
125 self.assert_(not hasattr(cdp, 'spectrometer_frq'))
126 self.assert_(not hasattr(cdp, 'ri_type'))
127 for spin in spin_loop():
128 self.assert_(not hasattr(spin, 'ri_data'))
129 self.assert_(not hasattr(spin, 'ri_data_err'))
130