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

Method test_empty_body

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

Source from the content-addressed store, hash-verified

523 self.assertNotIn('content-length', [k.lower() for k in headers])
524
525 def test_empty_body(self):
526 # Zero-length iterable should be treated like any other iterable
527 conn = client.HTTPConnection('example.com')
528 conn.sock = FakeSocket(b'')
529 conn.request('POST', '/', ())
530 _, headers, body = self._parse_request(conn.sock.data)
531 self.assertEqual(headers['Transfer-Encoding'], 'chunked')
532 self.assertNotIn('content-length', [k.lower() for k in headers])
533 self.assertEqual(body, b"0\r\n\r\n")
534
535 def _make_body(self, empty_lines=False):
536 lines = self.expected_body.split(b' ')

Callers

nothing calls this directly

Calls 6

requestMethod · 0.95
_parse_requestMethod · 0.95
assertNotInMethod · 0.80
FakeSocketClass · 0.70
assertEqualMethod · 0.45
lowerMethod · 0.45

Tested by

no test coverage detected