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

Method test_isabs

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

testerFunction · 0.85

Tested by

no test coverage detected