MCPcopy Create free account
hub / github.com/python/cpython / test_appexeclink

Method test_appexeclink

Lib/test/test_os/test_windows.py:396–416  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

394 pass
395
396 def test_appexeclink(self):
397 root = os.path.expandvars(r'%LOCALAPPDATA%\Microsoft\WindowsApps')
398 if not os.path.isdir(root):
399 self.skipTest("test requires a WindowsApps directory")
400
401 aliases = [os.path.join(root, a)
402 for a in fnmatch.filter(os.listdir(root), '*.exe')]
403
404 for alias in aliases:
405 if support.verbose:
406 print()
407 print("Testing with", alias)
408 st = os.lstat(alias)
409 self.assertEqual(st, os.stat(alias))
410 self.assertFalse(stat.S_ISLNK(st.st_mode))
411 self.assertEqual(st.st_reparse_tag, stat.IO_REPARSE_TAG_APPEXECLINK)
412 self.assertTrue(os.path.isfile(alias))
413 # testing the first one we see is sufficient
414 break
415 else:
416 self.skipTest("test requires an app execution alias")
417
418
419class Win32JunctionTests(unittest.TestCase):

Callers

nothing calls this directly

Calls 11

skipTestMethod · 0.80
listdirMethod · 0.80
lstatMethod · 0.80
assertFalseMethod · 0.80
assertTrueMethod · 0.80
isdirMethod · 0.45
joinMethod · 0.45
filterMethod · 0.45
assertEqualMethod · 0.45
statMethod · 0.45
isfileMethod · 0.45

Tested by

no test coverage detected