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

Method test_isjunction

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

Source from the content-addressed store, hash-verified

1394
1395 @unittest.skipIf(sys.platform != 'win32', "Can only test junctions with creation on win32.")
1396 def test_isjunction(self):
1397 with os_helper.temp_dir() as d:
1398 with os_helper.change_cwd(d):
1399 os.mkdir('tmpdir')
1400
1401 import _winapi
1402 try:
1403 _winapi.CreateJunction('tmpdir', 'testjunc')
1404 except OSError:
1405 raise unittest.SkipTest('creating the test junction failed')
1406
1407 self.assertTrue(ntpath.isjunction('testjunc'))
1408 self.assertFalse(ntpath.isjunction('tmpdir'))
1409 self.assertPathEqual(ntpath.realpath('testjunc'), ntpath.realpath('tmpdir'))
1410
1411 def test_isfile_invalid_paths(self):
1412 isfile = ntpath.isfile

Callers

nothing calls this directly

Calls 5

assertTrueMethod · 0.80
assertFalseMethod · 0.80
realpathMethod · 0.80
mkdirMethod · 0.45
assertPathEqualMethod · 0.45

Tested by

no test coverage detected