MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / test_corrupt

Method test_corrupt

test/mitmproxy/addons/test_readfile.py:78–87  ·  view source on GitHub ↗
(self, corrupt_data, caplog_async)

Source from the content-addressed store, hash-verified

76 await caplog_async.await_log("corrupted")
77
78 async def test_corrupt(self, corrupt_data, caplog_async):
79 rf = readfile.ReadFile()
80 with taddons.context(rf):
81 with pytest.raises(exceptions.FlowReadException):
82 await rf.load_flows(io.BytesIO(b"qibble"))
83
84 caplog_async.clear()
85 with pytest.raises(exceptions.FlowReadException):
86 await rf.load_flows(corrupt_data)
87 await caplog_async.await_log("file corrupted")
88
89 async def test_nonexistent_file(self, caplog):
90 rf = readfile.ReadFile()

Callers

nothing calls this directly

Calls 4

load_flowsMethod · 0.95
contextMethod · 0.80
await_logMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected