Ronny Pfannschmidt avatar Ronny Pfannschmidt committed 52a566f

fold my current wd into the userbase patch

Comments (0)

Files changed (2)

 # HG changeset patch
-# Parent 17250062114b72ef018755f2f307e3598139c54a
+# Parent dec82745fec19c89edd75bf0cebc6f14794a030f
 use a cusom PYTHONUSERBASE for testing --user
 
+diff --git a/tests/test_basic.py b/tests/test_basic.py
+--- a/tests/test_basic.py
++++ b/tests/test_basic.py
+@@ -277,6 +277,18 @@ def test_install_curdir():
+     assert fspkg_folder in result.files_created, str(result.stdout)
+     assert egg_info_folder in result.files_created, str(result)
+ 
++def test_install_curdir_usersite():
++    """
++    Test installing current directory ('.') into usersite
++    """
++    env = reset_env()
++    run_from = abspath(join(here, 'packages', 'FSPkg'))
++    result = run_pip('install', '--user', curdir, cwd=run_from, expect_error=False)
++    fspkg_folder = env.site_packages/'fspkg'
++    egg_info_folder = env.user_site/'FSPkg-0.1dev-py%s.egg-info' % pyversion
++    assert fspkg_folder in result.files_created, str(result.stdout)
++    print fspkg_folder in result.files_created, str(result.stdout)
++    assert egg_info_folder in result.files_created, str(result)
+ 
+ def test_install_pardir():
+     """
 diff --git a/tests/test_pip.py b/tests/test_pip.py
 --- a/tests/test_pip.py
 +++ b/tests/test_pip.py
-@@ -294,6 +294,9 @@ class TestPipEnvironment(TestFileEnviron
+@@ -258,7 +258,7 @@ class TestPipEnvironment(TestFileEnviron
+         self.scratch_path = self.root_path / self.scratch
+ 
+         self.venv_path = self.root_path / self.venv
+-
++        
+         if not environ:
+             environ = os.environ.copy()
+             environ = clear_environ(environ)
+@@ -289,6 +289,11 @@ class TestPipEnvironment(TestFileEnviron
          assert self.venv == TestPipEnvironment.venv # sanity check
  
          self.site_packages = self.lib/'site-packages'
-+        self.user_base = self.lib/'../user'
-+        demand_dirs(self.user_base)
-+        self.environ["PYTHONUSERBASE"] = self.user_base
++        self.user_base_path = self.venv_path/'user'
++        self.user_site_path = self.venv_path/'user'/self.lib.name/'site-packages'
++        self.user_site = relpath(self.root_path, self.user_site_path)
++        demand_dirs(self.user_base_path)
++        self.environ["PYTHONUSERBASE"] = self.user_base_path
  
          # put the test-scratch virtualenv's bin dir first on the PATH
          self.environ['PATH'] = Path.pathsep.join((self.bin_path, self.environ['PATH']))
-dec82745fec19c89edd75bf0cebc6f14794a030f:options-for-editable
-33dbadf465784fc612795d94fd4a88db53ed3961:custom-userbase
-ab6952246c6e1c0d315738281980a7efb771a54b:user-alias
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.