summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ftplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_ftplib.py')
-rw-r--r--Lib/test/test_ftplib.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index cf30a3d..e424076 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -19,7 +19,8 @@ except ImportError:
from unittest import TestCase, skipUnless
from test import support
-from test.support import HOST, HOSTv6
+from test.support import socket_helper
+from test.support.socket_helper import HOST, HOSTv6
TIMEOUT = support.LOOPBACK_TIMEOUT
DEFAULT_ENCODING = 'utf-8'
@@ -751,7 +752,7 @@ class TestFTPClass(TestCase):
def test_source_address(self):
self.client.quit()
- port = support.find_unused_port()
+ port = socket_helper.find_unused_port()
try:
self.client.connect(self.server.host, self.server.port,
source_address=(HOST, port))
@@ -763,7 +764,7 @@ class TestFTPClass(TestCase):
raise
def test_source_address_passive_connection(self):
- port = support.find_unused_port()
+ port = socket_helper.find_unused_port()
self.client.source_address = (HOST, port)
try:
with self.client.transfercmd('list') as sock:
@@ -816,7 +817,7 @@ class TestFTPClass(TestCase):
self.assertEqual(DEFAULT_ENCODING, client.encoding)
-@skipUnless(support.IPV6_ENABLED, "IPv6 not enabled")
+@skipUnless(socket_helper.IPV6_ENABLED, "IPv6 not enabled")
class TestIPv6Environment(TestCase):
def setUp(self):
@@ -1007,7 +1008,7 @@ class TestTimeouts(TestCase):
self.evt = threading.Event()
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.settimeout(20)
- self.port = support.bind_port(self.sock)
+ self.port = socket_helper.bind_port(self.sock)
self.server_thread = threading.Thread(target=self.server)
self.server_thread.daemon = True
self.server_thread.start()