MCPcopy Index your code
hub / github.com/python/cpython / test_remote_authority

Method test_remote_authority

Lib/test/test_urllib.py:185–193  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

183 self.assertRaises(ValueError,urllib.request.urlopen,'./' + self.pathname)
184
185 def test_remote_authority(self):
186 # Test for GH-90812.
187 url = 'file://pythontest.net/foo/bar'
188 with self.assertRaises(urllib.error.URLError) as e:
189 urllib.request.urlopen(url)
190 if os.name == 'nt':
191 self.assertEqual(e.exception.filename, r'\\pythontest.net\foo\bar')
192 else:
193 self.assertEqual(e.exception.reason, 'file:// scheme is supported only on localhost')
194
195
196class ProxyTests(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

assertRaisesMethod · 0.45
urlopenMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected