diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-02-05 21:20:51 +0100 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-02-05 21:20:51 +0100 |
commit | 758466eb76833619aebc6a88c58cc75a83672677 (patch) | |
tree | 45a11ffb9209c632bee7d104e7f39343d96dff8f /Lib/test/test_urllib2net.py | |
parent | c00297f4880ff5086953704a0f17a683c84bf80c (diff) | |
download | cpython-758466eb76833619aebc6a88c58cc75a83672677.tar.gz |
Issue #17107: Test client-side SNI support in urllib.request thanks to the new server-side SNI support in the ssl module.
Initial patch by Daniel Black.
Diffstat (limited to 'Lib/test/test_urllib2net.py')
-rw-r--r-- | Lib/test/test_urllib2net.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index b3c1a68234..e276d2ebfc 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -330,31 +330,9 @@ class TimeoutTest(unittest.TestCase): self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60) -@unittest.skipUnless(ssl, "requires SSL support") -class HTTPSTests(unittest.TestCase): - - def test_sni(self): - self.skipTest("test disabled - test server needed") - # Checks that Server Name Indication works, if supported by the - # OpenSSL linked to. - # The ssl module itself doesn't have server-side support for SNI, - # so we rely on a third-party test site. - expect_sni = ssl.HAS_SNI - with support.transient_internet("XXX"): - u = urllib.request.urlopen("XXX") - contents = u.readall() - if expect_sni: - self.assertIn(b"Great", contents) - self.assertNotIn(b"Unfortunately", contents) - else: - self.assertNotIn(b"Great", contents) - self.assertIn(b"Unfortunately", contents) - - def test_main(): support.requires("network") support.run_unittest(AuthTests, - HTTPSTests, OtherNetworkTests, CloseSocketTest, TimeoutTest, |