From b362e9a0131574636902f60554b293c0a98b83dd Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 3 Dec 2015 14:43:56 +0100 Subject: test flow conversion --- test/test_flow_format_compat.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/test_flow_format_compat.py (limited to 'test/test_flow_format_compat.py') 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 -- cgit v1.2.3