MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_from_uri_posix

Method test_from_uri_posix

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

Source from the content-addressed store, hash-verified

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

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