MCPcopy Index your code
hub / github.com/python/cpython / test_manual_content_length

Method test_manual_content_length

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

Source from the content-addressed store, hash-verified

2267 self.assertEqual(expected, f.read())
2268
2269 def test_manual_content_length(self):
2270 # Set an incorrect content-length so that we can verify that
2271 # it will not be over-ridden by the library.
2272 self.conn.request("PUT", "/url", "body",
2273 {"Content-Length": "42"})
2274 message, f = self.get_headers_and_fp()
2275 self.assertEqual("42", message.get("content-length"))
2276 self.assertEqual(4, len(f.read()))
2277
2278 def test_ascii_body(self):
2279 self.conn.request("PUT", "/url", "body")

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected