(self)
| 3297 | |
| 3298 | @needs_posix |
| 3299 | def test_from_uri_posix(self): |
| 3300 | P = self.cls |
| 3301 | self.assertEqual(P.from_uri('file:/foo/bar'), P('/foo/bar')) |
| 3302 | self.assertRaises(ValueError, P.from_uri, 'file://foo/bar') |
| 3303 | self.assertEqual(P.from_uri('file:///foo/bar'), P('/foo/bar')) |
| 3304 | self.assertEqual(P.from_uri('file:////foo/bar'), P('//foo/bar')) |
| 3305 | self.assertEqual(P.from_uri('file://localhost/foo/bar'), P('/foo/bar')) |
| 3306 | if not is_wasi: |
| 3307 | self.assertEqual(P.from_uri(f'file://{socket.gethostname()}/foo/bar'), |
| 3308 | P('/foo/bar')) |
| 3309 | self.assertRaises(ValueError, P.from_uri, 'foo/bar') |
| 3310 | self.assertRaises(ValueError, P.from_uri, '/foo/bar') |
| 3311 | self.assertRaises(ValueError, P.from_uri, '//foo/bar') |
| 3312 | self.assertRaises(ValueError, P.from_uri, 'file:foo/bar') |
| 3313 | self.assertRaises(ValueError, P.from_uri, 'http://foo/bar') |
| 3314 | |
| 3315 | @needs_posix |
| 3316 | def test_from_uri_pathname2url_posix(self): |
nothing calls this directly
no test coverage detected