summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2018-03-12 22:43:12 +0200
committerYuval Adam <_@yuv.al>2018-03-12 22:43:12 +0200
commit2f3a1e2fa48c39a190997fd60fce99ed1f9b7bca (patch)
tree0f66020e78ee824d1836cb60a2927968ec4bb703 /tests
parent4ccc60ad95b6089934a55b0cbb46d63097db90cc (diff)
Add support for formatted strings
Diffstat (limited to 'tests')
-rw-r--r--tests/test_parse.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_parse.py b/tests/test_parse.py
index aec69fe..cb0a354 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -40,6 +40,13 @@ class TestParse(object):
vs = ViewState(raw=b'\xff\x01\n\x01\x02')
assert vs.decode() == 'Color: unknown' # all colors are unknown for now
+ def test_formatted_string(self):
+ vs = ViewState()
+ s1 = 'System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
+ s2 = '6111733106'
+ vs.raw = b'\xff\x01()' + bytes([len(s1)]) + s1.encode() + bytes([len(s2)]) + s2.encode()
+ assert vs.decode() == 'Formatted string: {} {}'.format(s2, s1)
+
def test_complex_pair(self):
vs = ViewState()
vs.raw = b'\xff\x01\x0f\x67\x0f\x68\x66'