blob: 4997aff9d917de9a9a173c142478ee238849562a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
from mitmproxy import io
from mitmproxy import exceptions
from . import tutils
def test_load():
with open(tutils.test_data.path("data/dumpfile-011"), "rb") as f:
flow_reader = io.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-010"), "rb") as f:
flow_reader = io.FlowReader(f)
with tutils.raises(exceptions.FlowReadException):
list(flow_reader.stream())
|