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

Function test_load

test/mitmproxy/addons/test_view.py:252–267  ·  view source on GitHub ↗
(tmpdir, caplog)

Source from the content-addressed store, hash-verified

250
251
252async def test_load(tmpdir, caplog):
253 path = str(tmpdir.join("path"))
254 v = view.View()
255 tdump(path, [tflow.tflow(resp=True), tflow.tflow(resp=True)])
256 v.load_file(path)
257 assert len(v) == 2
258 v.load_file(path)
259 assert len(v) == 4
260 try:
261 v.load_file("nonexistent_file_path")
262 except OSError:
263 assert False
264 with open(path, "wb") as f:
265 f.write(b"invalidflows")
266 v.load_file(path)
267 assert "Invalid data format." in caplog.text
268
269
270def test_resolve():

Callers

nothing calls this directly

Calls 4

load_fileMethod · 0.95
tdumpFunction · 0.70
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…