(self)
| 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): |
nothing calls this directly
no test coverage detected