Permalink
Browse files

simpler, local --root test

  • Loading branch information...
1 parent ba7bac0 commit 61ed2b49eb88f851e4bd0addf6b22975d5014f28 @qwcode committed Feb 14, 2013
Showing with 8 additions and 5 deletions.
  1. +8 −5 tests/test_basic.py
View
@@ -12,7 +12,7 @@
from pip.exceptions import BadCommand
from tests.test_pip import (here, reset_env, run_pip, pyversion, mkdir,
- src_folder, write_file)
+ src_folder, write_file, path_to_url)
from tests.local_repos import local_checkout
from tests.path import Path
@@ -497,10 +497,13 @@ def test_install_package_with_root():
"""
env = reset_env()
root_dir = env.scratch_path/'root'
- result = run_pip('install', '--root', root_dir, "--install-option=--home=''",
- '--install-option=--install-lib=lib/python', "initools==0.1")
-
- assert Path('scratch')/'root'/'lib'/'python'/'initools' in result.files_created, str(result)
+ find_links = path_to_url(os.path.join(here, 'packages'))
+ result = run_pip('install', '--root', root_dir, '-f', find_links, '--no-index', 'simple==1.0')
+ normal_install_path = env.root_path / env.site_packages / 'simple-1.0-py%s.egg-info' % pyversion
+ #use distutils to change the root exactly how the --root option does it
+ from distutils.util import change_root
+ root_path = change_root(os.path.join(env.scratch, 'root'), normal_install_path)
+ assert root_path in result.files_created, str(result)
def test_find_command_folder_in_path():

0 comments on commit 61ed2b4

Please sign in to comment.