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

Method test_from_uri_windows

Lib/test/test_pathlib/test_pathlib.py:3418–3437  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3416
3417 @needs_windows
3418 def test_from_uri_windows(self):
3419 P = self.cls
3420 # DOS drive paths
3421 self.assertEqual(P.from_uri('file:c:/path/to/file'), P('c:/path/to/file'))
3422 self.assertEqual(P.from_uri('file:c|/path/to/file'), P('c:/path/to/file'))
3423 self.assertEqual(P.from_uri('file:/c|/path/to/file'), P('c:/path/to/file'))
3424 self.assertEqual(P.from_uri('file:///c|/path/to/file'), P('c:/path/to/file'))
3425 # UNC paths
3426 self.assertEqual(P.from_uri('file://server/path/to/file'), P('//server/path/to/file'))
3427 self.assertEqual(P.from_uri('file:////server/path/to/file'), P('//server/path/to/file'))
3428 self.assertEqual(P.from_uri('file://///server/path/to/file'), P('//server/path/to/file'))
3429 # Localhost paths
3430 self.assertEqual(P.from_uri('file://localhost/c:/path/to/file'), P('c:/path/to/file'))
3431 self.assertEqual(P.from_uri('file://localhost/c|/path/to/file'), P('c:/path/to/file'))
3432 # Invalid paths
3433 self.assertRaises(ValueError, P.from_uri, 'foo/bar')
3434 self.assertRaises(ValueError, P.from_uri, 'c:/foo/bar')
3435 self.assertRaises(ValueError, P.from_uri, '//foo/bar')
3436 self.assertRaises(ValueError, P.from_uri, 'file:foo/bar')
3437 self.assertRaises(ValueError, P.from_uri, 'http://foo/bar')
3438
3439 @needs_windows
3440 def test_from_uri_pathname2url_windows(self):

Callers

nothing calls this directly

Calls 4

from_uriMethod · 0.80
PClass · 0.70
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected