mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
testSendAll(): loop until all data is read; this was necessary at
least on OS/2 (see note on SF patch 555085 by A I MacIntyre) but looks like the test *could* fail on any other platform too -- there's no guarantee that recv() reads all data.
This commit is contained in:
parent
469cdad822
commit
e531e296fa
1 changed files with 3 additions and 3 deletions
|
@ -378,13 +378,13 @@ class BasicTCPTest(SocketConnectedTest):
|
|||
|
||||
def testSendAll(self):
|
||||
# Testing sendall() with a 2048 byte string over TCP
|
||||
msg = ''
|
||||
while 1:
|
||||
read = self.cli_conn.recv(1024)
|
||||
if not read:
|
||||
break
|
||||
self.assert_(len(read) == 1024, "Error performing sendall.")
|
||||
read = filter(lambda x: x == 'f', read)
|
||||
self.assert_(len(read) == 1024, "Error performing sendall.")
|
||||
msg += read
|
||||
self.assertEqual(msg, 'f' * 2048)
|
||||
|
||||
def _testSendAll(self):
|
||||
big_chunk = 'f' * 2048
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue