aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-03-11 15:16:31 +1300
committerAldo Cortesi <aldo@nullcube.com>2011-03-11 15:16:31 +1300
commit9f16a84a9e771dbbc3314daafaf63449de73d3eb (patch)
treea3e610eb6e629bf918d21cd9c22061ac487f0e36 /test
parent7d85db0da31186a5a80d3a925ab6382f6e5b42f9 (diff)
downloadmitmproxy-9f16a84a9e771dbbc3314daafaf63449de73d3eb.tar.gz
mitmproxy-9f16a84a9e771dbbc3314daafaf63449de73d3eb.tar.bz2
mitmproxy-9f16a84a9e771dbbc3314daafaf63449de73d3eb.zip
Make mitmdump handle invalid serialized data gracefully.
Diffstat (limited to 'test')
-rw-r--r--test/test_flow.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_flow.py b/test/test_flow.py
index 78892b5d..d2cb85dc 100644
--- a/test/test_flow.py
+++ b/test/test_flow.py
@@ -356,6 +356,16 @@ class uSerialize(libpry.AutoTree):
assert len(l) == 1
assert l[0] == f
+ def test_error(self):
+ sio = StringIO()
+ sio.write("bogus")
+ sio.seek(0)
+ r = flow.FlowReader(sio)
+ libpry.raises(flow.FlowReadError, list, r.stream())
+
+ f = flow.FlowReadError("foo")
+ assert f.strerror == "foo"
+
class uFlowMaster(libpry.AutoTree):
def test_all(self):