MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_bytes_body

Method test_bytes_body

Lib/test/test_httplib.py:2250–2256  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2248 self.assertEqual(b'body\xc1', f.read())
2249
2250 def test_bytes_body(self):
2251 self.conn.request("PUT", "/url", b"body\xc1")
2252 message, f = self.get_headers_and_fp()
2253 self.assertEqual("text/plain", message.get_content_type())
2254 self.assertIsNone(message.get_charset())
2255 self.assertEqual("5", message.get("content-length"))
2256 self.assertEqual(b'body\xc1', f.read())
2257
2258 def test_text_file_body(self):
2259 self.addCleanup(os_helper.unlink, os_helper.TESTFN)

Callers

nothing calls this directly

Calls 8

get_headers_and_fpMethod · 0.95
get_content_typeMethod · 0.80
assertIsNoneMethod · 0.80
get_charsetMethod · 0.80
requestMethod · 0.45
assertEqualMethod · 0.45
getMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected