Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test that symlinks are properly created in bin_dir

  • Loading branch information...
commit 1ee39cd3174b487038b62a3a6a66bac46571775a 1 parent 55180a5
@vhata vhata authored
Showing with 26 additions and 0 deletions.
  1. +26 −0 tests/test_virtualenv.py
View
26 tests/test_virtualenv.py
@@ -1,5 +1,9 @@
import virtualenv
import optparse
+import os
+import shutil
+import sys
+import tempfile
from mock import patch, Mock
@@ -92,3 +96,25 @@ def get_environ_vars(self, prefix='VIRTUALENV_'):
defaults = {}
cop.update_defaults(defaults)
assert defaults == {'system_site_packages': 0}
+
+def test_install_python_symlinks():
+ """Should create the right symlinks in bin_dir"""
+ tmp_virtualenv = tempfile.mkdtemp()
+ try:
+ home_dir, lib_dir, inc_dir, bin_dir = \
+ virtualenv.path_locations(tmp_virtualenv)
+ virtualenv.install_python(home_dir, lib_dir, inc_dir, bin_dir, False,
+ False)
+
+ py_exe_no_version = 'python'
+ py_exe_version_major = 'python%s' % sys.version_info[0]
+ py_exe_version_major_minor = 'python%s.%s' % (
+ sys.version_info[0], sys.version_info[1])
+ required_executables = [ py_exe_no_version, py_exe_version_major,
+ py_exe_version_major_minor ]
+
+ for pth in required_executables:
+ assert os.path.exists(os.path.join(bin_dir, pth)), ("%s should "
+ "exist in bin_dir" % pth)
+ finally:
+ shutil.rmtree(tmp_virtualenv)
Please sign in to comment.
Something went wrong with that request. Please try again.