Skip to content

Commit cd38c9d

Browse files
UI Updates (#121)
* Updating testing * Updating tests more * Added the pump device * Starting to work on GUI center * GUI now supports left, center, and right text justifications * Fixed tests and linting issues * Updated with changes
1 parent 6a1823c commit cd38c9d

40 files changed

Lines changed: 561 additions & 653 deletions

test/devices/stir_control_test.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
The file to test the StirControl class
33
"""
4-
import time
54
from unittest import mock
65
from unittest.mock import call
76

@@ -73,9 +72,8 @@ def test_set_stop():
7372
assert stir_controller._motor.duty_cycle == 0
7473

7574

76-
@mock.patch.object(time, "sleep")
7775
@mock.patch.object(StirControl, "_set_speed")
78-
def test_degas(_set_speed, sleep):
76+
def test_degas(_set_speed):
7977
"""
8078
The function to test the stir controller's degas function
8179
"""
@@ -85,4 +83,3 @@ def test_degas(_set_speed, sleep):
8583

8684
calls = [call(5000), call(3000)]
8785
_set_speed.assert_has_calls(calls)
88-
sleep.assert_called_with(0)

test/ui_state/calibration/calibrate_ph1_test.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def test_loop(print_mock):
4949
[
5050
mock.call("Enter buffer pH", line=1),
5151
mock.call("", line=2),
52-
mock.call("Press any to cont", line=3),
53-
mock.call("", line=4),
52+
mock.call("", line=3),
53+
mock.call("Any key to continue", line=4),
5454
]
5555
)
5656

@@ -60,8 +60,8 @@ def test_loop(print_mock):
6060
[
6161
mock.call("Put sensor in buffer", line=1),
6262
mock.call("", line=2),
63-
mock.call("Press any to cont", line=3),
64-
mock.call("to record value", line=4),
63+
mock.call("Any key to", line=3),
64+
mock.call("record value", line=4),
6565
]
6666
)
6767

@@ -75,8 +75,8 @@ def test_loop(print_mock):
7575
+ f" {calibrate_ph.titrator.buffer_measured_volts:>3.4f} V",
7676
line=2,
7777
),
78-
mock.call("Press any to cont", line=3),
79-
mock.call("", line=4),
78+
mock.call("", line=3),
79+
mock.call("Any key to continue", line=4),
8080
]
8181
)
8282

@@ -100,8 +100,8 @@ def test_calibrate_ph(print_mock, _set_next_state, get_voltage):
100100
[
101101
mock.call("Enter buffer pH", line=1),
102102
mock.call("", line=2),
103-
mock.call("Press any to cont", line=3),
104-
mock.call("", line=4),
103+
mock.call("", line=3),
104+
mock.call("Any key to continue", line=4),
105105
]
106106
)
107107

@@ -115,8 +115,8 @@ def test_calibrate_ph(print_mock, _set_next_state, get_voltage):
115115
[
116116
mock.call("Put sensor in buffer", line=1),
117117
mock.call("", line=2),
118-
mock.call("Press any to cont", line=3),
119-
mock.call("to record value", line=4),
118+
mock.call("Any key to", line=3),
119+
mock.call("record value", line=4),
120120
]
121121
)
122122

@@ -133,8 +133,8 @@ def test_calibrate_ph(print_mock, _set_next_state, get_voltage):
133133
+ f" {calibrate_ph.titrator.buffer_measured_volts:>3.4f} V",
134134
line=2,
135135
),
136-
mock.call("Press any to cont", line=3),
137-
mock.call("", line=4),
136+
mock.call("", line=3),
137+
mock.call("Any key to continue", line=4),
138138
]
139139
)
140140

test/ui_state/calibration/calibrate_temp_test.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def test_loop(print_mock):
5959
calibrate_temp.loop()
6060
print_mock.assert_has_calls(
6161
[
62-
mock.call("Set Probe One", line=1),
63-
mock.call("Reference Temp", line=2),
64-
mock.call("", line=3),
62+
mock.call("Set probe one", line=1),
63+
mock.call("reference", line=2),
64+
mock.call("temperature", line=3),
6565
mock.call("Any key to continue", line=4),
6666
]
6767
)
@@ -70,8 +70,8 @@ def test_loop(print_mock):
7070
calibrate_temp.loop()
7171
print_mock.assert_has_calls(
7272
[
73-
mock.call("Put Probe One in Sol", line=1),
74-
mock.call("", line=2),
73+
mock.call("Put probe one in", line=1),
74+
mock.call("solution", line=2),
7575
mock.call("Press any key to", line=3),
7676
mock.call("record temperature", line=4),
7777
]
@@ -81,7 +81,7 @@ def test_loop(print_mock):
8181
calibrate_temp.loop()
8282
print_mock.assert_has_calls(
8383
[
84-
mock.call("Probe One", line=1),
84+
mock.call("Probe one", line=1),
8585
mock.call(
8686
f"{(calibrate_temp.titrator.temperature_probe_control.get_temperature()):4.3f}",
8787
line=2,
@@ -98,9 +98,9 @@ def test_loop(print_mock):
9898
calibrate_temp.loop()
9999
print_mock.assert_has_calls(
100100
[
101-
mock.call("Set Probe Two", line=1),
102-
mock.call("Reference Temp", line=2),
103-
mock.call("", line=3),
101+
mock.call("Set probe two", line=1),
102+
mock.call("reference", line=2),
103+
mock.call("temperature", line=3),
104104
mock.call("Any key to continue", line=4),
105105
]
106106
)
@@ -109,8 +109,8 @@ def test_loop(print_mock):
109109
calibrate_temp.loop()
110110
print_mock.assert_has_calls(
111111
[
112-
mock.call("Put Probe Two in Sol", line=1),
113-
mock.call("", line=2),
112+
mock.call("Put probe two in", line=1),
113+
mock.call("solution", line=2),
114114
mock.call("Press any key to", line=3),
115115
mock.call("record temperature", line=4),
116116
]
@@ -120,7 +120,7 @@ def test_loop(print_mock):
120120
calibrate_temp.loop()
121121
print_mock.assert_has_calls(
122122
[
123-
mock.call("Probe Two", line=1),
123+
mock.call("Probe two", line=1),
124124
mock.call(
125125
f"{(calibrate_temp.titrator.temperature_probe_logging.get_temperature()):>4.3f}",
126126
line=2,
@@ -151,9 +151,9 @@ def test_calibrate_temp(print_mock, _set_next_state, calibrate):
151151
calibrate_temp.loop()
152152
print_mock.assert_has_calls(
153153
[
154-
mock.call("Set Probe One", line=1),
155-
mock.call("Reference Temp", line=2),
156-
mock.call("", line=3),
154+
mock.call("Set probe one", line=1),
155+
mock.call("reference", line=2),
156+
mock.call("temperature", line=3),
157157
mock.call("Any key to continue", line=4),
158158
]
159159
)
@@ -166,8 +166,8 @@ def test_calibrate_temp(print_mock, _set_next_state, calibrate):
166166
calibrate_temp.loop()
167167
print_mock.assert_has_calls(
168168
[
169-
mock.call("Put Probe One in Sol", line=1),
170-
mock.call("", line=2),
169+
mock.call("Put probe one in", line=1),
170+
mock.call("solution", line=2),
171171
mock.call("Press any key to", line=3),
172172
mock.call("record temperature", line=4),
173173
]
@@ -180,7 +180,7 @@ def test_calibrate_temp(print_mock, _set_next_state, calibrate):
180180
calibrate_temp.loop()
181181
print_mock.assert_has_calls(
182182
[
183-
mock.call("Probe One", line=1),
183+
mock.call("Probe one", line=1),
184184
mock.call(
185185
f"{(calibrate_temp.titrator.temperature_probe_control.get_temperature()):4.3f}",
186186
line=2,
@@ -199,9 +199,9 @@ def test_calibrate_temp(print_mock, _set_next_state, calibrate):
199199
calibrate_temp.loop()
200200
print_mock.assert_has_calls(
201201
[
202-
mock.call("Set Probe Two", line=1),
203-
mock.call("Reference Temp", line=2),
204-
mock.call("", line=3),
202+
mock.call("Set probe two", line=1),
203+
mock.call("reference", line=2),
204+
mock.call("temperature", line=3),
205205
mock.call("Any key to continue", line=4),
206206
]
207207
)
@@ -214,8 +214,8 @@ def test_calibrate_temp(print_mock, _set_next_state, calibrate):
214214
calibrate_temp.loop()
215215
print_mock.assert_has_calls(
216216
[
217-
mock.call("Put Probe Two in Sol", line=1),
218-
mock.call("", line=2),
217+
mock.call("Put probe two in", line=1),
218+
mock.call("solution", line=2),
219219
mock.call("Press any key to", line=3),
220220
mock.call("record temperature", line=4),
221221
]
@@ -228,7 +228,7 @@ def test_calibrate_temp(print_mock, _set_next_state, calibrate):
228228
calibrate_temp.loop()
229229
print_mock.assert_has_calls(
230230
[
231-
mock.call("Probe Two", line=1),
231+
mock.call("Probe two", line=1),
232232
mock.call(
233233
f"{(calibrate_temp.titrator.temperature_probe_logging.get_temperature()):>4.3f}",
234234
line=2,

0 commit comments

Comments
 (0)