summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-06-12 20:46:49 (GMT)
committerGuido van Rossum <guido@python.org>2002-06-12 20:46:49 (GMT)
commit733632ac1f61acc9b96ad316972a71b290e30db0 (patch)
tree802471269bfa9c000ccdfd0aefc22871dd6b4eb8 /Lib
parent764896871657cbe5063623f07be376728086e081 (diff)
downloadcpython-733632ac1f61acc9b96ad316972a71b290e30db0.zip
cpython-733632ac1f61acc9b96ad316972a71b290e30db0.tar.gz
cpython-733632ac1f61acc9b96ad316972a71b290e30db0.tar.bz2
testSetSockOpt() should not require the reuse flag to be 1 -- any
nonzero value is OK. Also fixed the error message for this and for testGetSockOpt().
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_socket.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 20961f6..8649a6b 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -253,14 +253,14 @@ class GeneralModuleTests(unittest.TestCase):
# We know a socket should start without reuse==0
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
reuse = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR)
- self.assert_(reuse == 0, "Error performing getsockopt.")
+ self.failIf(reuse != 0, "initial mode is reuse")
def testSetSockOpt(self):
"""Testing setsockopt()."""
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
reuse = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR)
- self.assert_(reuse == 1, "Error performing setsockopt.")
+ self.failIf(reuse == 0, "failed to set reuse mode")
class BasicTCPTest(SocketConnectedTest):