Update SpotArea

Update SpotArea and CLI command to more closely reflect the app
Library:
SpotArea namedarea -> area
SpotArea customarea -> map_position

CLI Commands:
spotclean -> area
Ex: sucks area 0,1
  - will clean areas 0 and 1 / A and B

area options:
--map-postion|-p
  - will clean a specified map coordinate
Ex: sucks area -p "-602,1812,800,723"
  - will clean the specified custom map coordinates
This commit is contained in:
Brian Martin
2019-02-20 10:45:24 -05:00
parent bfca7e9e82
commit b7341b0735
3 changed files with 26 additions and 21 deletions
+11 -11
View File
@@ -61,31 +61,31 @@ def test_spotarea_command():
assert_equals(ElementTree.tostring(c.to_xml()),
b'<ctl td="Clean"><clean act="s" mid="0" speed="standard" type="SpotArea" /></ctl>') #Test namedarea clean
c = SpotArea('start', namedarea='0')
c = SpotArea('start', area='0')
assert_equals(ElementTree.tostring(c.to_xml()),
b'<ctl td="Clean"><clean act="s" mid="0" speed="standard" type="SpotArea" /></ctl>') #Test namedarea keyword clean
c = SpotArea('start', '', '01234,56789')
c = SpotArea('start', '', '-602,1812,800,723')
assert_equals(ElementTree.tostring(c.to_xml()),
b'<ctl td="Clean"><clean act="s" deep="1" p="01234,56789" speed="standard" type="SpotArea" /></ctl>') #Test customarea clean
b'<ctl td="Clean"><clean act="s" deep="1" p="-602,1812,800,723" speed="standard" type="SpotArea" /></ctl>') #Test customarea clean
c = SpotArea('start', '', '01234,56789', '2')
c = SpotArea('start', '', '-602,1812,800,723', '2')
assert_equals(ElementTree.tostring(c.to_xml()),
b'<ctl td="Clean"><clean act="s" deep="2" p="01234,56789" speed="standard" type="SpotArea" /></ctl>') #Test customarea clean with deep 2
b'<ctl td="Clean"><clean act="s" deep="2" p="-602,1812,800,723" speed="standard" type="SpotArea" /></ctl>') #Test customarea clean with deep 2
c = SpotArea('start', '', customarea='01234,56789')
c = SpotArea('start', '', map_position='-602,1812,800,723')
assert_equals(ElementTree.tostring(c.to_xml()),
b'<ctl td="Clean"><clean act="s" deep="1" p="01234,56789" speed="standard" type="SpotArea" /></ctl>') #Test customarea keyword clean with deep default
b'<ctl td="Clean"><clean act="s" deep="1" p="-602,1812,800,723" speed="standard" type="SpotArea" /></ctl>') #Test customarea keyword clean with deep default
c = SpotArea('start', customarea='01234,56789', cleanings='2')
c = SpotArea('start', map_position='-602,1812,800,723', cleanings='2')
assert_equals(ElementTree.tostring(c.to_xml()),
b'<ctl td="Clean"><clean act="s" deep="2" p="01234,56789" speed="standard" type="SpotArea" /></ctl>') #Test customarea keyword and cleanings keyword clean with deep default
b'<ctl td="Clean"><clean act="s" deep="2" p="-602,1812,800,723" speed="standard" type="SpotArea" /></ctl>') #Test customarea keyword and cleanings keyword clean with deep default
c = SpotArea('start', namedarea='0', customarea='01234,56789', cleanings='2')
c = SpotArea('start', area='0', map_position='-602,1812,800,723', cleanings='2')
assert_equals(ElementTree.tostring(c.to_xml()),
b'<ctl td="Clean"><clean act="s" mid="0" speed="standard" type="SpotArea" /></ctl>') #Test all keywords specified, should default to only mid
c = SpotArea('start', '0', '01234,56789','2')
c = SpotArea('start', '0', '-602,1812,800,723','2')
assert_equals(ElementTree.tostring(c.to_xml()),
b'<ctl td="Clean"><clean act="s" mid="0" speed="standard" type="SpotArea" /></ctl>') #Test all keywords specified, should default to only mid