MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_rotate_stream

Function test_rotate_stream

test/mitmproxy/addons/test_save.py:167–181  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

165
166
167def test_rotate_stream(tmp_path):
168 sa = save.Save()
169 with taddons.context(sa) as tctx:
170 tctx.configure(sa, save_stream_file=str(tmp_path / "a.txt"))
171 f1 = tflow.tflow(resp=True)
172 f2 = tflow.tflow(resp=True)
173 sa.request(f1)
174 sa.response(f1)
175 sa.request(f2) # second request already started.
176 tctx.configure(sa, save_stream_file=str(tmp_path / "b.txt"))
177 sa.response(f2)
178 sa.done()
179
180 assert len(rd(tmp_path / "a.txt")) == 1
181 assert len(rd(tmp_path / "b.txt")) == 1
182
183
184def test_disk_full(tmp_path, monkeypatch, capsys):

Callers

nothing calls this directly

Calls 6

requestMethod · 0.95
responseMethod · 0.95
doneMethod · 0.95
contextMethod · 0.80
rdFunction · 0.70
configureMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…