MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_get_urlencoded_form

Method test_get_urlencoded_form

test/mitmproxy/test_http.py:415–422  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

413 assert "gzip" in request.headers["Accept-Encoding"]
414
415 def test_get_urlencoded_form(self):
416 request = treq(content=b"foobar=baz")
417 assert not request.urlencoded_form
418
419 request.headers["Content-Type"] = "application/x-www-form-urlencoded"
420 assert list(request.urlencoded_form.items()) == [("foobar", "baz")]
421 request.raw_content = b"\xff"
422 assert len(request.urlencoded_form) == 1
423
424 def test_set_urlencoded_form(self):
425 request = treq(content=b"\xec\xed")

Callers

nothing calls this directly

Calls 2

treqFunction · 0.90
itemsMethod · 0.45

Tested by

no test coverage detected