Skip to content

Commit

Permalink
Merge pull request #868 from techalchemy/add-pipenv-zipfile-install-test
Browse files Browse the repository at this point in the history
Introduces a test for PR #818 and issue #817 local sdists
  • Loading branch information
nateprewitt authored Oct 12, 2017
2 parents 8550639 + e12002b commit 8685ba8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Binary file added tests/test_artifacts/tablib-0.12.1.tar.gz
Binary file not shown.
24 changes: 24 additions & 0 deletions tests/test_pipenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,3 +651,27 @@ def test_urls_work(self):
dep = p.lockfile['default'][key]

assert 'file' in dep

@pytest.mark.install
@pytest.mark.files
def test_local_zipfiles(self):
file_name = 'tablib-0.12.1.tar.gz'
# Not sure where travis/appveyor run tests from
test_dir = os.path.dirname(os.path.abspath(__file__))
source_path = os.path.abspath(os.path.join(test_dir, 'test_artifacts', file_name))

with PipenvInstance() as p:
# This tests for a bug when installing a zipfile in the current dir
shutil.copy(source_path, os.path.join(p.path, file_name))

c = p.pipenv('install {}'.format(file_name))
key = [k for k in p.pipfile['packages'].keys()][0]
dep = p.pipfile['packages'][key]

assert 'file' in dep or 'path' in dep
assert c.return_code == 0

key = [k for k in p.lockfile['default'].keys()][0]
dep = p.lockfile['default'][key]

assert 'file' in dep or 'path' in dep

0 comments on commit 8685ba8

Please sign in to comment.