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