summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2020-02-01 14:37:32 +0200
committerGitHub <noreply@github.com>2020-02-01 14:37:32 +0200
commit0021e056c99c62c13966ee9114e1e31ee2b64302 (patch)
treead6519d9e966def1f7eb139c126afb32f18b7f07 /tests
parent961c4233f817617b18950df30c23b54f76060013 (diff)
Add support for known color parsing (#13)
* Added color parsing support * Fixed major flaw in parsing colors. * Removed debugging comments * Additional black run * Extract colors.py and restore Noop parser class * Test for unknown colors as well Co-authored-by: TiberiuD <TiberiuD@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_parse.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index fea1fd4..c1e1abb 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -38,11 +38,16 @@ class TestParse(object):
vs = ViewState(raw=b"\xff\x01\x10\x67\x68\x67")
assert vs.decode() == (True, False, True)
- @pytest.mark.skip(reason="Color parsing is not yet supported")
def test_color(self):
- vs = ViewState(raw=b"\xff\x01\n\x91\x01")
+ vs = ViewState(raw=b"\xff\x01\n\x91")
assert vs.decode() == "Color: Salmon"
+ vs = ViewState(raw=b"\xff\x01\n\x8d\x01")
+ assert vs.decode() == "Color: Red"
+
+ vs = ViewState(raw=b"\xff\x01\n\xff")
+ assert vs.decode() == "Color: Unknown"
+
def test_rgba(self):
vs = ViewState(raw=b"\xff\x01\x09\x10\x20\x30\x40")
assert vs.decode() == "RGBA(16,32,48,64)"