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

Method test_chunked_trailers

Lib/test/test_httplib.py:1396–1405  ·  view source on GitHub ↗

See that trailers are read and ignored

(self)

Source from the content-addressed store, hash-verified

1394 resp.close()
1395
1396 def test_chunked_trailers(self):
1397 """See that trailers are read and ignored"""
1398 expected = chunked_expected
1399 sock = FakeSocket(chunked_start + last_chunk + trailers + chunked_end)
1400 resp = client.HTTPResponse(sock, method="GET")
1401 resp.begin()
1402 self.assertEqual(resp.read(), expected)
1403 # we should have reached the end of the file
1404 self.assertEqual(sock.file.read(), b"") #we read to the end
1405 resp.close()
1406
1407 def test_chunked_sync(self):
1408 """Check that we don't read past the end of the chunked-encoding stream"""

Callers

nothing calls this directly

Calls 6

beginMethod · 0.95
readMethod · 0.95
closeMethod · 0.95
FakeSocketClass · 0.70
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected