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

Method test_simple

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

Source from the content-addressed store, hash-verified

1088
1089class TestMessageText:
1090 def test_simple(self):
1091 r = tresp(content=b"\xfc")
1092 assert r.raw_content == b"\xfc"
1093 assert r.content == b"\xfc"
1094 assert r.text == "ü"
1095
1096 r.encode("gzip")
1097 assert r.text == "ü"
1098 r.decode()
1099 assert r.text == "ü"
1100
1101 r.headers["content-type"] = "text/html; charset=latin1"
1102 r.content = b"\xc3\xbc"
1103 assert r.text == "ü"
1104 r.headers["content-type"] = "text/html; charset=utf8"
1105 assert r.text == "ü"
1106
1107 def test_guess_json(self):
1108 r = tresp(content=b'"\xc3\xbc"')

Callers

nothing calls this directly

Calls 3

trespFunction · 0.90
encodeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected