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

Method test_isabs

Lib/test/test_ntpath.py:283–299  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

281 (b'c:\\\xff', b'\xfe'))
282
283 def test_isabs(self):
284 tester('ntpath.isabs("foo\\bar")', 0)
285 tester('ntpath.isabs("foo/bar")', 0)
286 tester('ntpath.isabs("c:\\")', 1)
287 tester('ntpath.isabs("c:\\foo\\bar")', 1)
288 tester('ntpath.isabs("c:/foo/bar")', 1)
289 tester('ntpath.isabs("\\\\conky\\mountpoint\\")', 1)
290
291 # gh-44626: paths with only a drive or root are not absolute.
292 tester('ntpath.isabs("\\foo\\bar")', 0)
293 tester('ntpath.isabs("/foo/bar")', 0)
294 tester('ntpath.isabs("c:foo\\bar")', 0)
295 tester('ntpath.isabs("c:foo/bar")', 0)
296
297 # gh-96290: normal UNC paths and device paths without trailing backslashes
298 tester('ntpath.isabs("\\\\conky\\mountpoint")', 1)
299 tester('ntpath.isabs("\\\\.\\C:")', 1)
300
301 def test_commonprefix(self):
302 with warnings_helper.check_warnings((".*commonpath().*", DeprecationWarning)):

Callers

nothing calls this directly

Calls 1

testerFunction · 0.85

Tested by

no test coverage detected