diff options
| -rw-r--r-- | tests/test_core.py | 8 | ||||
| -rw-r--r-- | viewstate/core.py | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index a1a39a4..bfb6c4f 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -60,7 +60,7 @@ class TestViewState(object): assert vs.decode() == ((True, '1q2w3e'), 0) def test_parse_unknown(self): - vs = ViewState() - vs.raw = b'\xff\x01\x99\x99\x99' - assert vs.decode() == b'\x99\x99\x99' - + with pytest.raises(ViewStateException): + vs = ViewState() + vs.raw = b'\xff\x01\x99\x99\x99' + assert vs.decode() diff --git a/viewstate/core.py b/viewstate/core.py index 24db8a6..dbbac4d 100644 --- a/viewstate/core.py +++ b/viewstate/core.py @@ -61,6 +61,7 @@ def _parse(b): elif b[0] == 0x18: return parse_dict(b[1:]) else: + raise ViewStateException('Unable to parse remainder of bytes {}'.format(b)) return b, bytes() return None |
