summaryrefslogtreecommitdiff
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-03-31 18:56:11 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2007-03-31 18:56:11 +0000
commit65407fb7344d4ecdeecb8733831365c23a713ab6 (patch)
treea9b6176ba4cbda35577e3b437a3ab2732cefde16 /Lib/test/test_socket.py
parentef9e09e737914c9c5d91cf177df43fdad4be6000 (diff)
downloadcpython-git-65407fb7344d4ecdeecb8733831365c23a713ab6.tar.gz
Backport 54594:
Fix SF #1688393, sock.recvfrom(-24) crashes Also fix some method names that were copied incorrectly (trunk fixed).
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 84f1359f37..b5215214d1 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -583,6 +583,13 @@ class BasicUDPTest(ThreadedUDPSocketTest):
def _testRecvFrom(self):
self.cli.sendto(MSG, 0, (HOST, PORT))
+ def testRecvFromNegative(self):
+ # Negative lengths passed to recvfrom should give ValueError.
+ self.assertRaises(ValueError, self.serv.recvfrom, -1)
+
+ def _testRecvFromNegative(self):
+ self.cli.sendto(MSG, 0, (HOST, PORT))
+
class TCPCloserTest(ThreadedTCPSocketTest):
def testClose(self):