MCPcopy Index your code
hub / github.com/python/cpython / test_source_address

Method test_source_address

Lib/test/test_ftplib.py:795–806  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

793 self.assertFalse(is_client_connected())
794
795 def test_source_address(self):
796 self.client.quit()
797 port = socket_helper.find_unused_port()
798 try:
799 self.client.connect(self.server.host, self.server.port,
800 source_address=(HOST, port))
801 self.assertEqual(self.client.sock.getsockname()[1], port)
802 self.client.quit()
803 except OSError as e:
804 if e.errno == errno.EADDRINUSE:
805 self.skipTest("couldn't bind to port %d" % port)
806 raise
807
808 def test_source_address_passive_connection(self):
809 port = socket_helper.find_unused_port()

Callers

nothing calls this directly

Calls 5

skipTestMethod · 0.80
quitMethod · 0.45
connectMethod · 0.45
assertEqualMethod · 0.45
getsocknameMethod · 0.45

Tested by

no test coverage detected