mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
use pythontest.net for fragment redirection test
This commit is contained in:
parent
1d83002748
commit
b811a97859
1 changed files with 2 additions and 10 deletions
|
@ -8,13 +8,6 @@ import urllib.error
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
try:
|
|
||||||
import ssl
|
|
||||||
except ImportError:
|
|
||||||
ssl = None
|
|
||||||
|
|
||||||
requires_ssl = unittest.skipIf(ssl is None, "SSL not supported")
|
|
||||||
|
|
||||||
support.requires("network")
|
support.requires("network")
|
||||||
|
|
||||||
TIMEOUT = 60 # seconds
|
TIMEOUT = 60 # seconds
|
||||||
|
@ -167,14 +160,13 @@ class OtherNetworkTests(unittest.TestCase):
|
||||||
self.assertEqual(res.geturl(),
|
self.assertEqual(res.geturl(),
|
||||||
"http://www.pythontest.net/index.html#frag")
|
"http://www.pythontest.net/index.html#frag")
|
||||||
|
|
||||||
@requires_ssl
|
|
||||||
def test_redirect_url_withfrag(self):
|
def test_redirect_url_withfrag(self):
|
||||||
redirect_url_with_frag = "http://bit.ly/1iSHToT"
|
redirect_url_with_frag = "http://www.pythontest.net/redir/with_frag/"
|
||||||
with support.transient_internet(redirect_url_with_frag):
|
with support.transient_internet(redirect_url_with_frag):
|
||||||
req = urllib.request.Request(redirect_url_with_frag)
|
req = urllib.request.Request(redirect_url_with_frag)
|
||||||
res = urllib.request.urlopen(req)
|
res = urllib.request.urlopen(req)
|
||||||
self.assertEqual(res.geturl(),
|
self.assertEqual(res.geturl(),
|
||||||
"https://docs.python.org/3.4/glossary.html#term-global-interpreter-lock")
|
"http://www.pythontest.net/elsewhere/#frag")
|
||||||
|
|
||||||
def test_custom_headers(self):
|
def test_custom_headers(self):
|
||||||
url = "http://www.example.com"
|
url = "http://www.example.com"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue