MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_load

Function test_load

test/mitmproxy/addons/test_serverplayback.py:208–232  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206
207
208def test_load():
209 s = serverplayback.ServerPlayback()
210 with taddons.context(s) as tctx:
211 tctx.configure(s)
212
213 r = tflow.tflow(resp=True)
214 r.request.headers["key"] = "one"
215
216 r2 = tflow.tflow(resp=True)
217 r2.request.headers["key"] = "two"
218
219 s.load_flows([r, r2])
220
221 assert s.count() == 2
222
223 n = s.next_flow(r)
224 assert n.request.headers["key"] == "one"
225 assert s.count() == 1
226
227 n = s.next_flow(r)
228 assert n.request.headers["key"] == "two"
229 assert not s.flowmap
230 assert s.count() == 0
231
232 assert not s.next_flow(r)
233
234
235def test_load_with_server_replay_reuse():

Callers

nothing calls this directly

Calls 5

load_flowsMethod · 0.95
countMethod · 0.95
next_flowMethod · 0.95
contextMethod · 0.80
configureMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…