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

Method test_chunked

Lib/test/test_urllib2_localnet.py:522–534  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

520 self.assertEqual(handler.requests, ["/", "/somewhere_else"])
521
522 def test_chunked(self):
523 expected_response = b"hello world"
524 chunked_start = (
525 b'a\r\n'
526 b'hello worl\r\n'
527 b'1\r\n'
528 b'd\r\n'
529 b'0\r\n'
530 )
531 response = [(200, [("Transfer-Encoding", "chunked")], chunked_start)]
532 handler = self.start_server(response)
533 data = self.urlopen("http://localhost:%s/" % handler.port)
534 self.assertEqual(data, expected_response)
535
536 def test_404(self):
537 expected_response = b"Bad bad bad..."

Callers

nothing calls this directly

Calls 3

start_serverMethod · 0.95
urlopenMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected