summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httplib.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-04-29 07:36:20 (GMT)
committerGitHub <noreply@github.com>2020-04-29 07:36:20 (GMT)
commitbfb1cf44658934cbcd9707fb717d6770c78fbeb3 (patch)
treea9dcce79d42f76509491b3d8b165f6737143cbc5 /Lib/test/test_httplib.py
parentbb4a585d903e7fe0a46ded8c2ee3f47435ad6a66 (diff)
downloadcpython-bfb1cf44658934cbcd9707fb717d6770c78fbeb3.zip
cpython-bfb1cf44658934cbcd9707fb717d6770c78fbeb3.tar.gz
cpython-bfb1cf44658934cbcd9707fb717d6770c78fbeb3.tar.bz2
bpo-40275: Move transient_internet from test.support to socket_helper (GH-19711)
Diffstat (limited to 'Lib/test/test_httplib.py')
-rw-r--r--Lib/test/test_httplib.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index 6b7a9de..e95487b 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -1629,7 +1629,7 @@ class HTTPSTest(TestCase):
# Default settings: requires a valid cert from a trusted CA
import ssl
support.requires('network')
- with support.transient_internet('self-signed.pythontest.net'):
+ with socket_helper.transient_internet('self-signed.pythontest.net'):
h = client.HTTPSConnection('self-signed.pythontest.net', 443)
with self.assertRaises(ssl.SSLError) as exc_info:
h.request('GET', '/')
@@ -1639,7 +1639,7 @@ class HTTPSTest(TestCase):
# Switch off cert verification
import ssl
support.requires('network')
- with support.transient_internet('self-signed.pythontest.net'):
+ with socket_helper.transient_internet('self-signed.pythontest.net'):
context = ssl._create_unverified_context()
h = client.HTTPSConnection('self-signed.pythontest.net', 443,
context=context)
@@ -1653,7 +1653,7 @@ class HTTPSTest(TestCase):
def test_networked_trusted_by_default_cert(self):
# Default settings: requires a valid cert from a trusted CA
support.requires('network')
- with support.transient_internet('www.python.org'):
+ with socket_helper.transient_internet('www.python.org'):
h = client.HTTPSConnection('www.python.org', 443)
h.request('GET', '/')
resp = h.getresponse()
@@ -1667,7 +1667,7 @@ class HTTPSTest(TestCase):
import ssl
support.requires('network')
selfsigned_pythontestdotnet = 'self-signed.pythontest.net'
- with support.transient_internet(selfsigned_pythontestdotnet):
+ with socket_helper.transient_internet(selfsigned_pythontestdotnet):
context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
self.assertEqual(context.verify_mode, ssl.CERT_REQUIRED)
self.assertEqual(context.check_hostname, True)
@@ -1699,7 +1699,7 @@ class HTTPSTest(TestCase):
# We feed a "CA" cert that is unrelated to the server's cert
import ssl
support.requires('network')
- with support.transient_internet('self-signed.pythontest.net'):
+ with socket_helper.transient_internet('self-signed.pythontest.net'):
context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
context.load_verify_locations(CERT_localhost)
h = client.HTTPSConnection('self-signed.pythontest.net', 443, context=context)