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

Method test_chunked_trailers

Lib/test/test_httplib.py:1350–1359  ·  view source on GitHub ↗

See that trailers are read and ignored

(self)

Source from the content-addressed store, hash-verified

1348 resp.close()
1349
1350 def test_chunked_trailers(self):
1351 """See that trailers are read and ignored"""
1352 expected = chunked_expected
1353 sock = FakeSocket(chunked_start + last_chunk + trailers + chunked_end)
1354 resp = client.HTTPResponse(sock, method="GET")
1355 resp.begin()
1356 self.assertEqual(resp.read(), expected)
1357 # we should have reached the end of the file
1358 self.assertEqual(sock.file.read(), b"") #we read to the end
1359 resp.close()
1360
1361 def test_chunked_sync(self):
1362 """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