MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_from_uri_windows

Method test_from_uri_windows

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

Source from the content-addressed store, hash-verified

3425
3426 @needs_windows
3427 def test_from_uri_windows(self):
3428 P = self.cls
3429 # DOS drive paths
3430 self.assertEqual(P.from_uri('file:c:/path/to/file'), P('c:/path/to/file'))
3431 self.assertEqual(P.from_uri('file:c|/path/to/file'), P('c:/path/to/file'))
3432 self.assertEqual(P.from_uri('file:/c|/path/to/file'), P('c:/path/to/file'))
3433 self.assertEqual(P.from_uri('file:///c|/path/to/file'), P('c:/path/to/file'))
3434 # UNC paths
3435 self.assertEqual(P.from_uri('file://server/path/to/file'), P('//server/path/to/file'))
3436 self.assertEqual(P.from_uri('file:////server/path/to/file'), P('//server/path/to/file'))
3437 self.assertEqual(P.from_uri('file://///server/path/to/file'), P('//server/path/to/file'))
3438 # Localhost paths
3439 self.assertEqual(P.from_uri('file://localhost/c:/path/to/file'), P('c:/path/to/file'))
3440 self.assertEqual(P.from_uri('file://localhost/c|/path/to/file'), P('c:/path/to/file'))
3441 # Invalid paths
3442 self.assertRaises(ValueError, P.from_uri, 'foo/bar')
3443 self.assertRaises(ValueError, P.from_uri, 'c:/foo/bar')
3444 self.assertRaises(ValueError, P.from_uri, '//foo/bar')
3445 self.assertRaises(ValueError, P.from_uri, 'file:foo/bar')
3446 self.assertRaises(ValueError, P.from_uri, 'http://foo/bar')
3447
3448 @needs_windows
3449 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