mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Minor spell fix and formatting fixes in urllib tests. (#959)
This commit is contained in:
parent
11fa3c7cd1
commit
efbd4ea65d
2 changed files with 6 additions and 2 deletions
|
@ -206,6 +206,7 @@ class urlopen_FileTests(unittest.TestCase):
|
||||||
def test_relativelocalfile(self):
|
def test_relativelocalfile(self):
|
||||||
self.assertRaises(ValueError,urllib.request.urlopen,'./' + self.pathname)
|
self.assertRaises(ValueError,urllib.request.urlopen,'./' + self.pathname)
|
||||||
|
|
||||||
|
|
||||||
class ProxyTests(unittest.TestCase):
|
class ProxyTests(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -259,6 +260,7 @@ class ProxyTests(unittest.TestCase):
|
||||||
self.assertFalse(bypass('newdomain.com')) # no port
|
self.assertFalse(bypass('newdomain.com')) # no port
|
||||||
self.assertFalse(bypass('newdomain.com:1235')) # wrong port
|
self.assertFalse(bypass('newdomain.com:1235')) # wrong port
|
||||||
|
|
||||||
|
|
||||||
class ProxyTests_withOrderedEnv(unittest.TestCase):
|
class ProxyTests_withOrderedEnv(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -294,6 +296,7 @@ class ProxyTests_withOrderedEnv(unittest.TestCase):
|
||||||
proxies = urllib.request.getproxies_environment()
|
proxies = urllib.request.getproxies_environment()
|
||||||
self.assertEqual('http://somewhere:3128', proxies['http'])
|
self.assertEqual('http://somewhere:3128', proxies['http'])
|
||||||
|
|
||||||
|
|
||||||
class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin, FakeFTPMixin):
|
class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin, FakeFTPMixin):
|
||||||
"""Test urlopen() opening a fake http connection."""
|
"""Test urlopen() opening a fake http connection."""
|
||||||
|
|
||||||
|
@ -432,7 +435,6 @@ Connection: close
|
||||||
finally:
|
finally:
|
||||||
self.unfakeftp()
|
self.unfakeftp()
|
||||||
|
|
||||||
|
|
||||||
def test_userpass_inurl(self):
|
def test_userpass_inurl(self):
|
||||||
self.fakehttp(b"HTTP/1.0 200 OK\r\n\r\nHello!")
|
self.fakehttp(b"HTTP/1.0 200 OK\r\n\r\nHello!")
|
||||||
try:
|
try:
|
||||||
|
@ -476,6 +478,7 @@ Connection: close
|
||||||
"https://localhost", cafile="/nonexistent/path", context=context
|
"https://localhost", cafile="/nonexistent/path", context=context
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class urlopen_DataTests(unittest.TestCase):
|
class urlopen_DataTests(unittest.TestCase):
|
||||||
"""Test urlopen() opening a data URL."""
|
"""Test urlopen() opening a data URL."""
|
||||||
|
|
||||||
|
@ -549,6 +552,7 @@ class urlopen_DataTests(unittest.TestCase):
|
||||||
# missing padding character
|
# missing padding character
|
||||||
self.assertRaises(ValueError,urllib.request.urlopen,'data:;base64,Cg=')
|
self.assertRaises(ValueError,urllib.request.urlopen,'data:;base64,Cg=')
|
||||||
|
|
||||||
|
|
||||||
class urlretrieve_FileTests(unittest.TestCase):
|
class urlretrieve_FileTests(unittest.TestCase):
|
||||||
"""Test urllib.urlretrieve() on local files"""
|
"""Test urllib.urlretrieve() on local files"""
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ class URLTimeoutTest(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
class urlopenNetworkTests(unittest.TestCase):
|
class urlopenNetworkTests(unittest.TestCase):
|
||||||
"""Tests urllib.reqest.urlopen using the network.
|
"""Tests urllib.request.urlopen using the network.
|
||||||
|
|
||||||
These tests are not exhaustive. Assuming that testing using files does a
|
These tests are not exhaustive. Assuming that testing using files does a
|
||||||
good job overall of some of the basic interface features. There are no
|
good job overall of some of the basic interface features. There are no
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue