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

Method test_empty_body

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

Source from the content-addressed store, hash-verified

477 self.assertNotIn('content-length', [k.lower() for k in headers])
478
479 def test_empty_body(self):
480 # Zero-length iterable should be treated like any other iterable
481 conn = client.HTTPConnection('example.com')
482 conn.sock = FakeSocket(b'')
483 conn.request('POST', '/', ())
484 _, headers, body = self._parse_request(conn.sock.data)
485 self.assertEqual(headers['Transfer-Encoding'], 'chunked')
486 self.assertNotIn('content-length', [k.lower() for k in headers])
487 self.assertEqual(body, b"0\r\n\r\n")
488
489 def _make_body(self, empty_lines=False):
490 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