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

Method test_as_uri_non_ascii

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

Source from the content-addressed store, hash-verified

661
662 @needs_posix
663 def test_as_uri_non_ascii(self):
664 from urllib.parse import quote_from_bytes
665 P = self.cls
666 try:
667 os.fsencode('\xe9')
668 except UnicodeEncodeError:
669 self.skipTest("\\xe9 cannot be encoded to the filesystem encoding")
670 self.assertEqual(self.make_uri(P('/a/b\xe9')),
671 'file:///a/b' + quote_from_bytes(os.fsencode('\xe9')))
672
673 @needs_posix
674 def test_parse_windows_path(self):

Callers

nothing calls this directly

Calls 5

make_uriMethod · 0.95
quote_from_bytesFunction · 0.90
skipTestMethod · 0.80
PClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected