Reorganize command structure; add tests; add a little protocol documentation.

This commit is contained in:
William Pietri
2017-11-02 09:05:48 -07:00
parent 6f29c96e61
commit ff272c87eb
4 changed files with 76 additions and 30 deletions
+19
View File
@@ -0,0 +1,19 @@
from xml.etree import ElementTree
from nose.tools import assert_equals
from sucks import *
def test_clean_command():
c = Clean(10)
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(ElementTree.tostring(c.to_xml()),
b'<ctl td="Charge"><charge type="go" /></ctl>')