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

Method test_init

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

Source from the content-addressed store, hash-verified

463
464class TestResponseData:
465 def test_init(self):
466 with pytest.raises(ValueError):
467 tresp(headers="foobar")
468 with pytest.raises(UnicodeEncodeError):
469 tresp(http_version="föö/bä.r")
470 with pytest.raises(UnicodeEncodeError):
471 tresp(reason="fööbär")
472 with pytest.raises(ValueError):
473 tresp(content="foobar")
474 with pytest.raises(ValueError):
475 tresp(trailers="foobar")
476
477 assert isinstance(tresp(headers=()).headers, Headers)
478 assert isinstance(tresp(trailers=()).trailers, Headers)
479
480
481class TestResponseCore:

Callers

nothing calls this directly

Calls 1

trespFunction · 0.90

Tested by

no test coverage detected