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

Method test_init

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

Source from the content-addressed store, hash-verified

72
73class TestRequestData:
74 def test_init(self):
75 with pytest.raises(UnicodeEncodeError):
76 treq(method="fööbär")
77 with pytest.raises(UnicodeEncodeError):
78 treq(scheme="fööbär")
79 assert treq(host="fööbär").host == "fööbär"
80 with pytest.raises(UnicodeEncodeError):
81 treq(path="/fööbär")
82 with pytest.raises(UnicodeEncodeError):
83 treq(http_version="föö/bä.r")
84 with pytest.raises(ValueError):
85 treq(headers="foobar")
86 with pytest.raises(ValueError):
87 treq(content="foobar")
88 with pytest.raises(ValueError):
89 treq(trailers="foobar")
90
91 assert isinstance(treq(headers=()).headers, Headers)
92 assert isinstance(treq(trailers=()).trailers, Headers)
93
94
95class TestRequestCore:

Callers

nothing calls this directly

Calls 1

treqFunction · 0.90

Tested by

no test coverage detected