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

Method test_early_eof

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

Source from the content-addressed store, hash-verified

1301 self.assertRaises(client.LineTooLong, resp.read)
1302
1303 def test_early_eof(self):
1304 # Test httpresponse with no \r\n termination,
1305 body = "HTTP/1.1 200 Ok"
1306 sock = FakeSocket(body)
1307 resp = client.HTTPResponse(sock)
1308 resp.begin()
1309 self.assertEqual(resp.read(), b'')
1310 self.assertTrue(resp.isclosed())
1311 self.assertFalse(resp.closed)
1312 resp.close()
1313 self.assertTrue(resp.closed)
1314
1315 def test_error_leak(self):
1316 # Test that the socket is not leaked if getresponse() fails

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected