forked from sjkingo/virtualenv-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes sjkingo#42 Also allows to install packages with -e (editable) option
- Loading branch information
Showing
3 changed files
with
150 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,14 @@ | |
import tempfile | ||
import unittest | ||
|
||
from virtualenvapi import __version__, __file__ as virtualenvapi_file_path | ||
from virtualenvapi.manage import VirtualEnvironment | ||
|
||
virtualenvapi_module_path = os.path.dirname(os.path.dirname(virtualenvapi_file_path)) | ||
packages_for_tests = ['pep8'] | ||
non_lowercase_packages_for_test = ['Pillow'] | ||
all_packages_for_tests = packages_for_tests + non_lowercase_packages_for_test | ||
git_packages_for_test = ['git+https://github.com/pytest-dev/[email protected]'] | ||
all_packages_for_tests = packages_for_tests + non_lowercase_packages_for_test + git_packages_for_test | ||
|
||
def which(program): | ||
def is_exe(fpath): | ||
|
@@ -80,14 +83,23 @@ def test_install_requirements(self): | |
for pack in packages_for_tests: | ||
self.assertTrue(self.virtual_env_obj.is_installed(pack)) | ||
|
||
def test_install_editable(self): | ||
self.virtual_env_obj.install('-e git+file://{}#egg=virtualenv-api'.format(virtualenvapi_module_path)) | ||
print(self.virtual_env_obj.installed_packages) | ||
self.assertTrue(self.virtual_env_obj.is_installed('virtualenv-api')) | ||
self.assertFalse(self.virtual_env_obj.is_installed(('virtualenv-api', __version__))) | ||
|
||
def test_uninstall(self): | ||
self._install_packages(all_packages_for_tests) | ||
for pack in all_packages_for_tests: | ||
if pack.endswith('.git'): | ||
pack = pack.split('/')[-1].replace('.git', '') | ||
self.virtual_env_obj.uninstall(pack) | ||
self.assertFalse(self.virtual_env_obj.is_installed(pack)) | ||
|
||
def test_uninstall_editable(self): | ||
self.virtual_env_obj.install('-e git+file://{}#egg=virtualenv-api'.format(virtualenvapi_module_path)) | ||
self.assertFalse(self.virtual_env_obj.is_installed('virtualenv-api')) | ||
self.assertFalse(self.virtual_env_obj.is_installed(('virtualenv-api', __version__))) | ||
|
||
def test_wheel(self): | ||
self.virtual_env_obj.install('wheel') # required for this test | ||
for pack in packages_for_tests: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.