diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-12-03 14:43:56 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-12-03 14:43:56 +0100 |
commit | b362e9a0131574636902f60554b293c0a98b83dd (patch) | |
tree | c8ddce482799dd1e34693adebab446be31a2734a /test/test_flow_format_compat.py | |
parent | d1ce1aa993eb431a0db9048a42830c1234571c29 (diff) | |
download | mitmproxy-b362e9a0131574636902f60554b293c0a98b83dd.tar.gz mitmproxy-b362e9a0131574636902f60554b293c0a98b83dd.tar.bz2 mitmproxy-b362e9a0131574636902f60554b293c0a98b83dd.zip |
test flow conversion
Diffstat (limited to 'test/test_flow_format_compat.py')
-rw-r--r-- | test/test_flow_format_compat.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_flow_format_compat.py b/test/test_flow_format_compat.py new file mode 100644 index 00000000..1073e298 --- /dev/null +++ b/test/test_flow_format_compat.py @@ -0,0 +1,17 @@ +from libmproxy.flow import FlowReader, FlowReadError +import tutils + + +def test_load(): + with open(tutils.test_data.path("data/dumpfile-013"), "rb") as f: + flow_reader = FlowReader(f) + flows = list(flow_reader.stream()) + assert len(flows) == 1 + assert flows[0].request.url == "https://example.com/" + + +def test_cannot_convert(): + with open(tutils.test_data.path("data/dumpfile-012"), "rb") as f: + flow_reader = FlowReader(f) + with tutils.raises(FlowReadError): + list(flow_reader.stream())
\ No newline at end of file |