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

Method test_abspath_issue3426

Lib/test/test_genericpath.py:512–528  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

510 self.assertEqual(self.pathmodule.normpath(path), path)
511
512 def test_abspath_issue3426(self):
513 # Check that abspath returns unicode when the arg is unicode
514 # with both ASCII and non-ASCII cwds.
515 abspath = self.pathmodule.abspath
516 for path in ('', 'fuu', 'f\xf9\xf9', '/fuu', 'U:\\'):
517 self.assertIsInstance(abspath(path), str)
518
519 unicwd = '\xe7w\xf0'
520 try:
521 os.fsencode(unicwd)
522 except (AttributeError, UnicodeEncodeError):
523 # FS encoding is probably ASCII
524 pass
525 else:
526 with os_helper.temp_cwd(unicwd):
527 for path in ('', 'fuu', 'f\xf9\xf9', '/fuu', 'U:\\'):
528 self.assertIsInstance(abspath(path), str)
529
530 def test_nonascii_abspath(self):
531 if (

Callers

nothing calls this directly

Calls 2

assertIsInstanceMethod · 0.80
abspathFunction · 0.70

Tested by

no test coverage detected