-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtests_EAGGui.py
More file actions
73 lines (56 loc) · 1.97 KB
/
Copy pathtests_EAGGui.py
File metadata and controls
73 lines (56 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from EAGGui import *
import GUI_helper_functions
def test_slice_button_is_disabled():
loadedData = EAGanalysis("Raw data - mix and segments, 12.5.21.ASC")
#main loop
test_main = Tk()
AnalysisTimeFrame = Entry(test_main)
AnalysisTimeFrame.insert(0, "1")
SlicedData = Button(text="Slice data")
#checked if slice data disabled
slice_data(AnalysisTimeFrame,SlicedData,loadedData)
if SlicedData["state"] == DISABLED:
test_main.destroy()
return "success test_slice_button_is_disabled"
else:
test_main.destroy()
return "error test_slice_button_is_disabled"
test_main.mainloop()
def test_subtract_blank_button_is_disabled():
loadedData = EAGanalysis("Raw data - mix and segments, 12.5.21.ASC")
#main loop
test_main = Tk()
SlicedData = Button(text="Slice data")
SlicedData["state"]=DISABLED
BlankExperimentsEntry = Entry(test_main)
BlankExperimentsEntry.insert(0, "1")
OffsetSampelsEntry = Entry(test_main)
SubstractBlankExperiments = Button(
text="Subtract blank and offset")
#checked if slice data disabled
subtract_blank(SlicedData, BlankExperimentsEntry, OffsetSampelsEntry,
SubstractBlankExperiments)
if SubstractBlankExperiments["state"] == DISABLED:
test_main.destroy()
return "success test_subtract_blank_button_is_disabled"
else:
test_main.destroy()
return "error test_subtract_blank_button_is_disabled"
test_main.mainloop()
if __name__ == "__main__":
methods = ["test_slice_button_is_disabled", "test_subtract_blank_button_is_disabled"]
results = []
failed = []
passed = []
for method in methods:
result = eval(method)()
if "error" in result:
failed.append(result)
else:
passed.append(result)
print("Tests failed:")
for fail in failed:
print(fail)
print("Tests passed:")
for success in passed:
print(success)