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

Method test_negative_content_length

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

Source from the content-addressed store, hash-verified

1221 self.assertTrue(resp.closed)
1222
1223 def test_negative_content_length(self):
1224 sock = FakeSocket(
1225 'HTTP/1.1 200 OK\r\nContent-Length: -1\r\n\r\nHello\r\n')
1226 resp = client.HTTPResponse(sock, method="GET")
1227 resp.begin()
1228 self.assertEqual(resp.read(), b'Hello\r\n')
1229 self.assertTrue(resp.isclosed())
1230
1231 def test_incomplete_read(self):
1232 sock = FakeSocket('HTTP/1.1 200 OK\r\nContent-Length: 10\r\n\r\nHello\r\n')

Callers

nothing calls this directly

Calls 6

beginMethod · 0.95
readMethod · 0.95
isclosedMethod · 0.95
assertTrueMethod · 0.80
FakeSocketClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected