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

Method test_symlinking

Lib/test/test_venv.py:451–468  ·  view source on GitHub ↗

Test symlinking works as expected

(self)

Source from the content-addressed store, hash-verified

449
450 @unittest.skipUnless(can_symlink(), 'Needs symlinks')
451 def test_symlinking(self):
452 """
453 Test symlinking works as expected
454 """
455 for usl in (False, True):
456 builder = venv.EnvBuilder(clear=True, symlinks=usl)
457 builder.create(self.env_dir)
458 fn = self.get_env_file(self.bindir, self.exe)
459 # Don't test when False, because e.g. 'python' is always
460 # symlinked to 'python3.3' in the env, even when symlinking in
461 # general isn't wanted.
462 if usl:
463 if self.cannot_link_exe:
464 # Symlinking is skipped when our executable is already a
465 # special app symlink
466 self.assertFalse(os.path.islink(fn))
467 else:
468 self.assertTrue(os.path.islink(fn))
469
470 # If a venv is created from a source build and that venv is used to
471 # run the test, the pyvenv.cfg in the venv created in the test will

Callers

nothing calls this directly

Calls 5

get_env_fileMethod · 0.80
assertFalseMethod · 0.80
islinkMethod · 0.80
assertTrueMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected