2015-12-03 13:43:56 +00:00
|
|
|
from libmproxy.flow import FlowReader, FlowReadError
|
2016-02-02 12:25:31 +00:00
|
|
|
from . import tutils
|
2015-12-03 13:43:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
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):
|
2016-01-27 09:12:18 +00:00
|
|
|
list(flow_reader.stream())
|