]> granicus.if.org Git - python/commitdiff
Merged revisions 77286 via svnmerge from
authorGregory P. Smith <greg@mad-scientist.com>
Sun, 3 Jan 2010 15:09:32 +0000 (15:09 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Sun, 3 Jan 2010 15:09:32 +0000 (15:09 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77286 | gregory.p.smith | 2010-01-03 07:05:52 -0800 (Sun, 03 Jan 2010) | 2 lines

  Fix testSourceAddress to not test the host, it wasn't passing on some platforms.
........

Lib/test/test_socket.py

index 62c2e253c8fb7897acff6c3f0e6f09fab746897f..09e2cc89de185db86ea1a5f4752eeb110588adc4 100644 (file)
@@ -1008,18 +1008,13 @@ class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
         self.cli = socket.create_connection((HOST, self.port), timeout=30)
         self.assertEqual(self.cli.family, 2)
 
-    testSourcePort = _justAccept
-    def _testSourcePort(self):
+    testSourceAddress = _justAccept
+    def _testSourceAddress(self):
         self.cli = socket.create_connection((HOST, self.port), timeout=30,
                 source_address=('', self.source_port))
         self.assertEqual(self.cli.getsockname()[1], self.source_port)
-
-    testSourceAddress = _justAccept
-    def _testSourceAddress(self):
-        self.cli = socket.create_connection(
-                (HOST, self.port), 30, ('127.0.0.1', self.source_port))
-        self.assertEqual(self.cli.getsockname(),
-                         ('127.0.0.1', self.source_port))
+        # The port number being used is sufficient to show that the bind()
+        # call happened.
 
     testTimeoutDefault = _justAccept
     def _testTimeoutDefault(self):