1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 """Module for testing the special features of the user function GUI windows."""
23
24
25 from os import sep
26
27
28 from status import Status; status = Status()
29 from test_suite.gui_tests.base_classes import GuiTestCase
30
31
32 from gui.interpreter import Interpreter; interpreter = Interpreter()
33 from gui.string_conv import float_to_gui, int_to_gui, str_to_gui
34 from gui.uf_objects import Uf_storage; uf_store = Uf_storage()
35
36
38 """Class for testing special features of the user function GUI windows."""
39
41 """Test the full operation of the structure.read_pdb user function GUI window."""
42
43
44 uf = uf_store['pipe.create']
45 uf._sync = True
46 uf.create_wizard(parent=self.app.gui)
47 uf.page.SetValue('pipe_name', str_to_gui('PDB reading test'))
48 uf.page.SetValue('pipe_type', str_to_gui('mf'))
49 uf.wizard._go_next(None)
50
51
52 uf = uf_store['structure.read_pdb']
53 uf._sync = True
54 uf.create_wizard(parent=self.app.gui)
55
56
57 file = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'structures' + sep + 'trunc_ubi_pcs.pdb'
58 uf.page.SetValue('file', str_to_gui(file))
59
60
61 uf.page.SetValue('read_model', str_to_gui('6'))
62 uf.page.uf_args['read_model'].selection_win_show()
63 uf.page.uf_args['read_model'].sel_win.append_row(None)
64 uf.page.uf_args['read_model'].sel_win.sequence.SetStringItem(index=0, col=0, label=int_to_gui(2))
65 uf.page.uf_args['read_model'].sel_win.sequence.SetStringItem(index=1, col=0, label=int_to_gui(4))
66 uf.page.uf_args['read_model'].selection_win_data()
67
68
69 uf.page.uf_args['set_model_num'].selection_win_show()
70 uf.page.uf_args['set_model_num'].sel_win.append_row(None)
71 uf.page.uf_args['set_model_num'].sel_win.append_row(None)
72 uf.page.uf_args['set_model_num'].sel_win.sequence.SetStringItem(index=0, col=0, label=int_to_gui(1))
73 uf.page.uf_args['set_model_num'].sel_win.sequence.SetStringItem(index=1, col=0, label=int_to_gui(3))
74 uf.page.uf_args['set_model_num'].selection_win_data()
75
76
77 self.assertEqual(uf.page.uf_args['read_model'].GetValue(), [2, 4])
78 self.assertEqual(uf.page.uf_args['set_model_num'].GetValue(), [1, 3])
79
80
81 uf.wizard._go_next(None)
82
83
84 self.assert_(hasattr(cdp, 'structure'))
85 self.assert_(hasattr(cdp.structure, 'structural_data'))
86 self.assertEqual(len(cdp.structure.structural_data), 2)
87 self.assertEqual(cdp.structure.structural_data[0].num, 1)
88 self.assertEqual(cdp.structure.structural_data[1].num, 3)
89
90
118