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

Method test_isjunction

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

Source from the content-addressed store, hash-verified

1511
1512 @unittest.skipIf(sys.platform != 'win32', "Can only test junctions with creation on win32.")
1513 def test_isjunction(self):
1514 with os_helper.temp_dir() as d:
1515 with os_helper.change_cwd(d):
1516 os.mkdir('tmpdir')
1517
1518 import _winapi
1519 try:
1520 _winapi.CreateJunction('tmpdir', 'testjunc')
1521 except OSError:
1522 raise unittest.SkipTest('creating the test junction failed')
1523
1524 self.assertTrue(ntpath.isjunction('testjunc'))
1525 self.assertFalse(ntpath.isjunction('tmpdir'))
1526 self.assertPathEqual(ntpath.realpath('testjunc'), ntpath.realpath('tmpdir'))
1527
1528 def test_isfile_invalid_paths(self):
1529 isfile = ntpath.isfile

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected