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

Method test_manual_content_length

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

Source from the content-addressed store, hash-verified

2223 self.assertEqual(expected, f.read())
2224
2225 def test_manual_content_length(self):
2226 # Set an incorrect content-length so that we can verify that
2227 # it will not be over-ridden by the library.
2228 self.conn.request("PUT", "/url", "body",
2229 {"Content-Length": "42"})
2230 message, f = self.get_headers_and_fp()
2231 self.assertEqual("42", message.get("content-length"))
2232 self.assertEqual(4, len(f.read()))
2233
2234 def test_ascii_body(self):
2235 self.conn.request("PUT", "/url", "body")

Callers

nothing calls this directly

Calls 6

get_headers_and_fpMethod · 0.95
lenFunction · 0.85
requestMethod · 0.45
assertEqualMethod · 0.45
getMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected