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

Method test_expanduser_common

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

Source from the content-addressed store, hash-verified

1267
1268 @unittest.skipIf(is_wasi, "WASI has no user accounts.")
1269 def test_expanduser_common(self):
1270 P = self.cls
1271 p = P('~')
1272 self.assertEqual(p.expanduser(), P(os.path.expanduser('~')))
1273 p = P('foo')
1274 self.assertEqual(p.expanduser(), p)
1275 p = P('/~')
1276 self.assertEqual(p.expanduser(), p)
1277 p = P('../~')
1278 self.assertEqual(p.expanduser(), p)
1279 p = P(P('').absolute().anchor) / '~'
1280 self.assertEqual(p.expanduser(), p)
1281 p = P('~/a:b')
1282 self.assertEqual(p.expanduser(), P(os.path.expanduser('~'), './a:b'))
1283
1284 def test_with_segments(self):
1285 class P(self.cls):

Callers

nothing calls this directly

Calls 4

expanduserMethod · 0.80
absoluteMethod · 0.80
PClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected