MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / test_constrain_encoding

Method test_constrain_encoding

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

Source from the content-addressed store, hash-verified

401 assert request.headers["Accept-Encoding"] == "identity"
402
403 def test_constrain_encoding(self):
404 request = treq()
405
406 h = request.headers.copy()
407 request.constrain_encoding() # no-op if there is no accept_encoding header.
408 assert request.headers == h
409
410 request.headers["Accept-Encoding"] = "identity, gzip, foo"
411 request.constrain_encoding()
412 assert "foo" not in request.headers["Accept-Encoding"]
413 assert "gzip" in request.headers["Accept-Encoding"]
414
415 def test_get_urlencoded_form(self):
416 request = treq(content=b"foobar=baz")

Callers

nothing calls this directly

Calls 3

treqFunction · 0.90
constrain_encodingMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected