MCPcopy Index your code
hub / github.com/python/cpython / test_from_uri_posix

Method test_from_uri_posix

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

Source from the content-addressed store, hash-verified

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):

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