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

Method test_incomplete_read

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

Source from the content-addressed store, hash-verified

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')
1233 resp = client.HTTPResponse(sock, method="GET")
1234 resp.begin()
1235 try:
1236 resp.read()
1237 except client.IncompleteRead as i:
1238 self.assertEqual(i.partial, b'Hello\r\n')
1239 self.assertEqual(repr(i),
1240 "IncompleteRead(7 bytes read, 3 more expected)")
1241 self.assertEqual(str(i),
1242 "IncompleteRead(7 bytes read, 3 more expected)")
1243 self.assertTrue(resp.isclosed())
1244 else:
1245 self.fail('IncompleteRead expected')
1246
1247 def test_epipe(self):
1248 sock = EPipeSocket(

Callers

nothing calls this directly

Calls 9

beginMethod · 0.95
readMethod · 0.95
isclosedMethod · 0.95
reprFunction · 0.85
strFunction · 0.85
assertTrueMethod · 0.80
FakeSocketClass · 0.70
assertEqualMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected