MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_cannot_decode

Method test_cannot_decode

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

Source from the content-addressed store, hash-verified

1177 assert r.get_text(strict=False) == "foo"
1178
1179 def test_cannot_decode(self):
1180 r = tresp()
1181 r.headers["content-type"] = "text/html; charset=utf8"
1182 r.raw_content = b"\xff"
1183 with pytest.raises(ValueError):
1184 assert r.text
1185
1186 assert r.get_text(strict=False) == "\udcff"
1187
1188 def test_cannot_encode(self):
1189 r = tresp()

Callers

nothing calls this directly

Calls 2

trespFunction · 0.90
get_textMethod · 0.45

Tested by

no test coverage detected