MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_order

Function test_order

test/mitmproxy/addons/test_script.py:319–340  ·  view source on GitHub ↗

Integration test: Make sure that the runtime hooks are triggered on startup in the correct order.

(tdata, capsys)

Source from the content-addressed store, hash-verified

317
318
319def test_order(tdata, capsys):
320 """Integration test: Make sure that the runtime hooks are triggered on startup in the correct order."""
321 main.mitmdump(
322 [
323 "-n",
324 "-s",
325 tdata.path("mitmproxy/data/addonscripts/recorder/recorder.py"),
326 "-s",
327 tdata.path("mitmproxy/data/addonscripts/shutdown.py"),
328 ]
329 )
330 time = r"\[[\d:.]+\] "
331 out = capsys.readouterr().out
332 assert re.match(
333 rf"{time}Loading script.+recorder.py\n"
334 rf"{time}\('recorder', 'load', .+\n"
335 rf"{time}\('recorder', 'configure', .+\n"
336 rf"{time}Loading script.+shutdown.py\n"
337 rf"{time}\('recorder', 'running', .+\n"
338 rf"{time}\('recorder', 'done', .+\n$",
339 out,
340 )

Callers

nothing calls this directly

Calls 2

pathMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…