MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_modify_form

Method test_modify_form

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

Source from the content-addressed store, hash-verified

21 assert "tEST!" in result
22
23 def test_modify_form(self, tdata):
24 with taddons.context() as tctx:
25 sc = tctx.script(tdata.path("../examples/addons/http-modify-form.py"))
26
27 form_header = Headers(content_type="application/x-www-form-urlencoded")
28 f = tflow.tflow(req=tutils.treq(headers=form_header))
29 sc.request(f)
30
31 assert f.request.urlencoded_form["mitmproxy"] == "rocks"
32
33 f.request.headers["content-type"] = ""
34 sc.request(f)
35 assert list(f.request.urlencoded_form.items()) == [("foo", "bar")]
36
37 def test_modify_querystring(self, tdata):
38 with taddons.context() as tctx:

Callers

nothing calls this directly

Calls 6

HeadersClass · 0.90
contextMethod · 0.80
scriptMethod · 0.80
pathMethod · 0.45
requestMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected