forked from natuition/field
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_adapters_manual.py
49 lines (33 loc) · 1 KB
/
test_adapters_manual.py
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
import adapters
from config import config
sma = adapters.SmoothieAdapter(config.SMOOTHIE_HOST)
smc = sma.get_connector()
tn = smc.get_telnet()
def test_switch_to_relative():
r = sma.try_get_response()
assert r == ""
r = sma.switch_to_relative()
assert r == sma.RESPONSE_OK
r = sma.try_get_response()
assert r == ""
def test_halt():
r = sma.try_get_response()
assert r == ""
r = sma.halt()
assert r == "ok Emergency Stop Requested - reset or M999 required to exit HALT state\r\n"
r = sma.try_get_response()
assert r == ""
r = sma.switch_to_relative()
assert r == sma.RESPONSE_ALARM_LOCK
r = sma.reset()
assert r == "WARNING: After HALT you should HOME as position is currently unknown\nok\n"
r = sma.try_get_response()
assert r == ""
r = sma.switch_to_relative()
assert r == sma.RESPONSE_OK
r = sma.try_get_response()
assert r == ""
if __name__ == "__main__":
test_switch_to_relative()
test_halt()
print("Done.")