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

Method test_repr_common

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

Source from the content-addressed store, hash-verified

300 self.assertIsInstance(p, pathlib.PurePosixPath)
301
302 def test_repr_common(self):
303 for pathstr in ('a', 'a/b', 'a/b/c', '/', '/a/b', '/a/b/c'):
304 with self.subTest(pathstr=pathstr):
305 p = self.cls(pathstr)
306 clsname = p.__class__.__name__
307 r = repr(p)
308 # The repr() is in the form ClassName("forward-slashes path").
309 self.assertStartsWith(r, clsname + '(')
310 self.assertEndsWith(r, ')')
311 inner = r[len(clsname) + 1 : -1]
312 self.assertEqual(eval(inner), p.as_posix())
313
314 def test_fspath_common(self):
315 P = self.cls

Callers

nothing calls this directly

Calls 9

reprFunction · 0.85
lenFunction · 0.85
subTestMethod · 0.80
as_posixMethod · 0.80
evalFunction · 0.50
clsMethod · 0.45
assertStartsWithMethod · 0.45
assertEndsWithMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected