Files
ha_ecovacs_bumper/test_sucks.py
T
William Pietri d88fbb35b2 Added stop command.
Cleaned up output; made debugging option work properly.
Track basic robot state reports.
Stop command waits for robot to stop.
 Charge command  waits for robot to dock.
2017-11-03 21:02:20 -07:00

29 lines
794 B
Python

from xml.etree import ElementTree
from nose.tools import assert_equals
from sucks import *
def test_clean_command():
c = Clean(10)
assert_equals(c.terminal, False)
assert_equals(c.wait, 10)
assert_equals(ElementTree.tostring(c.to_xml()),
b'<ctl td="Clean"><clean speed="standard" type="auto" /></ctl>') # protocol has attribs in other order
def test_charge_command():
c = Charge()
assert_equals(c.terminal, True)
assert_equals(ElementTree.tostring(c.to_xml()),
b'<ctl td="Charge"><charge type="go" /></ctl>')
def test_stop_command():
c = Stop()
assert_equals(c.terminal, True)
assert_equals(ElementTree.tostring(c.to_xml()),
b'<ctl td="Clean"><clean speed="standard" type="stop" /></ctl>')