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

Method test_attributes_junctions

Lib/test/test_os/test_os.py:4900–4912  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4898
4899 @unittest.skipIf(sys.platform != 'win32', "Can only test junctions with creation on win32.")
4900 def test_attributes_junctions(self):
4901 dirname = os.path.join(self.path, "tgtdir")
4902 os.mkdir(dirname)
4903
4904 import _winapi
4905 try:
4906 _winapi.CreateJunction(dirname, os.path.join(self.path, "srcjunc"))
4907 except OSError:
4908 raise unittest.SkipTest('creating the test junction failed')
4909
4910 entries = self.get_entries(['srcjunc', 'tgtdir'])
4911 self.assertEqual(entries['srcjunc'].is_junction(), True)
4912 self.assertEqual(entries['tgtdir'].is_junction(), False)
4913
4914 def get_entry(self, name):
4915 path = self.bytes_path if isinstance(name, bytes) else self.path

Callers

nothing calls this directly

Calls 5

get_entriesMethod · 0.95
is_junctionMethod · 0.80
joinMethod · 0.45
mkdirMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected