summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2018-02-19 21:51:57 +0100
committerYuval Adam <_@yuv.al>2018-02-19 21:51:57 +0100
commit945dadfae8047c8c74d8b2b50486156198926568 (patch)
tree79cdf234b9328ff6623a357f1eccd6ee2fd1ad80 /tests
parentb78bb2cc81bfa47ac96ea5233eb7cbaedbb38934 (diff)
Add string support
Diffstat (limited to 'tests')
-rw-r--r--tests/test_core.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 1b132ac..be4c587 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -29,6 +29,12 @@ class TestViewState(object):
vs.raw = b'\xff\x01\x67'
assert vs.decode() is True
+ def test_parse_string_value(self):
+ vs = ViewState()
+ s = 'abcdefghij'
+ vs.raw = b'\xff\x01\x05\x0a' + s.encode()
+ assert vs.decode() == s
+
def test_parse_simple_pair(self):
vs = ViewState()
vs.raw = b'\xff\x01\x0f\x67\x68'
@@ -40,6 +46,8 @@ class TestViewState(object):
assert vs.decode() == (True, (False, 0))
vs.raw = b'\xff\x01\x0f\x0f\x67\x68\x66'
assert vs.decode() == ((True, False), 0)
+ vs.raw = b'\xff\x01\x0f\x0f\x67\x05\x061q2w3e\x66'
+ assert vs.decode() == ((True, '1q2w3e'), 0)
def test_parse_unknown(self):
vs = ViewState()