diff options
author | Guido van Rossum <guido@python.org> | 2002-08-08 20:28:34 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-08-08 20:28:34 (GMT) |
commit | e531e296fa178a3a8fc8ec708035e5255f327227 (patch) | |
tree | a4237c6aafbf272071e17f19f88646b71ae2404d | |
parent | 469cdad8228df7bc294dc946b8cd4c0b7f810735 (diff) | |
download | cpython-e531e296fa178a3a8fc8ec708035e5255f327227.zip cpython-e531e296fa178a3a8fc8ec708035e5255f327227.tar.gz cpython-e531e296fa178a3a8fc8ec708035e5255f327227.tar.bz2 |
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.
-rw-r--r-- | Lib/test/test_socket.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 69113fd..3583d41 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -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 |