(self)
| 3306 | |
| 3307 | @needs_posix |
| 3308 | def test_from_uri_posix(self): |
| 3309 | P = self.cls |
| 3310 | self.assertEqual(P.from_uri('file:/foo/bar'), P('/foo/bar')) |
| 3311 | self.assertRaises(ValueError, P.from_uri, 'file://foo/bar') |
| 3312 | self.assertEqual(P.from_uri('file:///foo/bar'), P('/foo/bar')) |
| 3313 | self.assertEqual(P.from_uri('file:////foo/bar'), P('//foo/bar')) |
| 3314 | self.assertEqual(P.from_uri('file://localhost/foo/bar'), P('/foo/bar')) |
| 3315 | if not is_wasi: |
| 3316 | self.assertEqual(P.from_uri(f'file://{socket.gethostname()}/foo/bar'), |
| 3317 | P('/foo/bar')) |
| 3318 | self.assertRaises(ValueError, P.from_uri, 'foo/bar') |
| 3319 | self.assertRaises(ValueError, P.from_uri, '/foo/bar') |
| 3320 | self.assertRaises(ValueError, P.from_uri, '//foo/bar') |
| 3321 | self.assertRaises(ValueError, P.from_uri, 'file:foo/bar') |
| 3322 | self.assertRaises(ValueError, P.from_uri, 'http://foo/bar') |
| 3323 | |
| 3324 | @needs_posix |
| 3325 | def test_from_uri_pathname2url_posix(self): |
nothing calls this directly
no test coverage detected