-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_interactive.py
More file actions
100 lines (81 loc) · 2.62 KB
/
Copy pathtest_interactive.py
File metadata and controls
100 lines (81 loc) · 2.62 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/env python3
"""Test script to verify all interactive functions work without errors."""
import sys
sys.path.insert(0, '.')
from tnt.app import TNTApp
def test_app_functions():
"""Test all action methods to ensure they don't raise errors."""
app = TNTApp()
app.load_network()
print("Testing action methods...")
# Test mode changes
try:
app.action_set_mode_mag()
print("✓ action_set_mode_mag")
except Exception as e:
print(f"✗ action_set_mode_mag: {e}")
try:
app.action_set_mode_phase()
print("✓ action_set_mode_phase")
except Exception as e:
print(f"✗ action_set_mode_phase: {e}")
try:
app.action_set_mode_db()
print("✓ action_set_mode_db")
except Exception as e:
print(f"✗ action_set_mode_db: {e}")
try:
app.action_set_mode_smith()
print("✓ action_set_mode_smith")
except Exception as e:
print(f"✗ action_set_mode_smith: {e}")
# Test S-parameter mode changes
try:
app.action_set_sparam_all()
print("✓ action_set_sparam_all")
except Exception as e:
print(f"✗ action_set_sparam_all: {e}")
try:
app.action_set_sparam_one()
print("✓ action_set_sparam_one")
except Exception as e:
print(f"✗ action_set_sparam_one: {e}")
try:
app.action_set_sparam_reflects()
print("✓ action_set_sparam_reflects")
except Exception as e:
print(f"✗ action_set_sparam_reflects: {e}")
try:
app.action_set_sparam_transmits()
print("✓ action_set_sparam_transmits")
except Exception as e:
print(f"✗ action_set_sparam_transmits: {e}")
# Test other controls
try:
app.action_toggle_grid()
print("✓ action_toggle_grid")
except Exception as e:
print(f"✗ action_toggle_grid: {e}")
try:
app.action_increase_y()
print("✓ action_increase_y")
except Exception as e:
print(f"✗ action_increase_y: {e}")
try:
app.action_decrease_y()
print("✓ action_decrease_y")
except Exception as e:
print(f"✗ action_decrease_y: {e}")
try:
app.action_prev_sparam()
print("✓ action_prev_sparam")
except Exception as e:
print(f"✗ action_prev_sparam: {e}")
try:
app.action_next_sparam()
print("✓ action_next_sparam")
except Exception as e:
print(f"✗ action_next_sparam: {e}")
print("\nAll tests completed!")
if __name__ == "__main__":
test_app_functions()