From 93d52c1d030646c4fd4afe053b1673ad99d9e20d Mon Sep 17 00:00:00 2001 From: Vladimir Dmitriev Date: Fri, 8 Nov 2013 00:20:38 +0400 Subject: [PATCH] Add a unit test for --always-copy option --- tests/test_virtualenv.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_virtualenv.py b/tests/test_virtualenv.py index 8c5eb62da..5f2fc5622 100644 --- a/tests/test_virtualenv.py +++ b/tests/test_virtualenv.py @@ -121,3 +121,20 @@ def test_install_python_bin(): "exist in bin_dir" % pth) finally: shutil.rmtree(tmp_virtualenv) + + +def test_always_copy_option(): + """Should be no symlinks in directory tree""" + if virtualenv.is_win: + return # no symlinks on win32 + tmp_virtualenv = tempfile.mkdtemp() + try: + virtualenv.create_environment(tmp_virtualenv, symlink=False) + + for root, dirs, files in os.walk(tmp_virtualenv): + for f in files: + full_name = os.path.join(root, f) + assert not os.path.islink(full_name), "%s should not be a" \ + " symlink" % full_name + finally: + shutil.rmtree(tmp_virtualenv)