Merge pull request #868 from techalchemy/add-pipenv-zipfile-install-test

Introduces a test for PR #818 and issue #817 local sdists
This commit is contained in:
Nate Prewitt
2017-10-11 20:52:36 -07:00
committed by GitHub
2 changed files with 24 additions and 0 deletions
Binary file not shown.
+24
View File
@@ -651,3 +651,27 @@ requests = "==2.14.0"
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