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

Method test_source_address_passive_connection

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

Source from the content-addressed store, hash-verified

806 raise
807
808 def test_source_address_passive_connection(self):
809 port = socket_helper.find_unused_port()
810 self.client.source_address = (HOST, port)
811 try:
812 with self.client.transfercmd('list') as sock:
813 self.assertEqual(sock.getsockname()[1], port)
814 except OSError as e:
815 if e.errno == errno.EADDRINUSE:
816 self.skipTest("couldn't bind to port %d" % port)
817 raise
818
819 def test_parse257(self):
820 self.assertEqual(ftplib.parse257('257 "/foo/bar"'), '/foo/bar')

Callers

nothing calls this directly

Calls 4

transfercmdMethod · 0.80
skipTestMethod · 0.80
assertEqualMethod · 0.45
getsocknameMethod · 0.45

Tested by

no test coverage detected