diff options
| author | Yuval Adam <_@yuv.al> | 2018-02-19 19:03:10 +0100 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2018-02-19 19:03:10 +0100 |
| commit | 7704bbabd2c36e3307d7b66171d0b9bfdb69cd7f (patch) | |
| tree | 01c9c2150541def27e3507ee2b6a05c4ff30668d /tests | |
| parent | 975f0b5eb59eedb0f3855e929f867046bec24bf0 (diff) | |
Pair parsing is working
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_core.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index d001d22..1b132ac 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -29,3 +29,20 @@ class TestViewState(object): vs.raw = b'\xff\x01\x67' assert vs.decode() is True + def test_parse_simple_pair(self): + vs = ViewState() + vs.raw = b'\xff\x01\x0f\x67\x68' + assert vs.decode() == (True, False) + + def test_parse_complex_pair(self): + vs = ViewState() + vs.raw = b'\xff\x01\x0f\x67\x0f\x68\x66' + assert vs.decode() == (True, (False, 0)) + vs.raw = b'\xff\x01\x0f\x0f\x67\x68\x66' + assert vs.decode() == ((True, False), 0) + + def test_parse_unknown(self): + vs = ViewState() + vs.raw = b'\xff\x01\x99\x99\x99' + assert vs.decode() == b'\x99\x99\x99' + |
