MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_modify_querystring

Method test_modify_querystring

test/examples/test_examples.py:37–49  ·  view source on GitHub ↗
(self, tdata)

Source from the content-addressed store, hash-verified

35 assert list(f.request.urlencoded_form.items()) == [("foo", "bar")]
36
37 def test_modify_querystring(self, tdata):
38 with taddons.context() as tctx:
39 sc = tctx.script(
40 tdata.path("../examples/addons/http-modify-query-string.py")
41 )
42 f = tflow.tflow(req=tutils.treq(path="/search?q=term"))
43
44 sc.request(f)
45 assert f.request.query["mitmproxy"] == "rocks"
46
47 f.request.path = "/"
48 sc.request(f)
49 assert f.request.query["mitmproxy"] == "rocks"
50
51 def test_redirect_requests(self, tdata):
52 with taddons.context() as tctx:

Callers

nothing calls this directly

Calls 4

contextMethod · 0.80
scriptMethod · 0.80
pathMethod · 0.45
requestMethod · 0.45

Tested by

no test coverage detected