MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_cut_save_open

Function test_cut_save_open

test/mitmproxy/addons/test_cut.py:147–158  ·  view source on GitHub ↗
(exception, log_message, tmpdir, caplog)

Source from the content-addressed store, hash-verified

145 ],
146)
147async def test_cut_save_open(exception, log_message, tmpdir, caplog):
148 f = str(tmpdir.join("path"))
149 v = view.View()
150 c = cut.Cut()
151 with taddons.context() as tctx:
152 tctx.master.addons.add(v, c)
153 v.add([tflow.tflow(resp=True)])
154
155 with mock.patch("mitmproxy.addons.cut.open") as m:
156 m.side_effect = exception(log_message)
157 tctx.command(c.save, "@all", "request.method", f)
158 assert log_message in caplog.text
159
160
161def test_cut():

Callers

nothing calls this directly

Calls 5

addMethod · 0.95
contextMethod · 0.80
commandMethod · 0.80
joinMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…