Skip to content

Commit

Permalink
add unit test for double pinned prerelease
Browse files Browse the repository at this point in the history
Fix #1696
Fix #1687
Reference #1693

Signed-off-by: Gaetan Semet <[email protected]>
  • Loading branch information
gsemet committed Mar 14, 2018
1 parent f33e557 commit a25cfa7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
38 changes: 38 additions & 0 deletions tests/test_pipenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,3 +1064,41 @@ def test_install_local_file_collision(self, pypi):
assert target_package in p.pipfile['packages']
assert p.pipfile['packages'][target_package] == '*'
assert target_package in p.lockfile['default']

@pytest.mark.install
@pytest.mark.local_file
def test_install_pinned_range_preversion(self, pypi):
with PipenvInstance(pypi=pypi) as p:
target_package = 'py2neo'
preversion = '==4.0.0b1'
transitive_pkg_name = 'neo4j-driver'
transitive_pkg_pinned_version = '==1.1.0rc1'
transitive_pkg_version = '==1.1.0rc1'
c = p.pipenv('install {0}{1}'.format(target_package, preversion))
assert c.return_code == 0
c = p.pipenv('install {0}{1}'.format(transitive_pkg_name, transitive_pkg_version))
assert c.return_code == 0
assert target_package in p.pipfile['packages']
assert p.pipfile['packages'][target_package] == preversion
assert target_package in p.lockfile['default']
assert transitive_pkg_name in p.lockfile['default']
assert p.lockfile['default'][transitive_pkg_name]['version'] == transitive_pkg_pinned_version

@pytest.mark.install
@pytest.mark.local_file
def test_install_pinned_pinned_preversion(self, pypi):
with PipenvInstance(pypi=pypi) as p:
target_package = 'py2neo'
preversion = '==4.0.0b1'
transitive_pkg_name = 'neo4j-driver'
transitive_pkg_pinned_version = '==1.1.0rc1'
transitive_pkg_version = '>=1.1.0rc1'
c = p.pipenv('install {0}{1}'.format(target_package, preversion))
assert c.return_code == 0
c = p.pipenv('install {0}{1}'.format(transitive_pkg_name, transitive_pkg_version))
assert c.return_code == 0
assert target_package in p.pipfile['packages']
assert p.pipfile['packages'][target_package] == preversion
assert target_package in p.lockfile['default']
assert transitive_pkg_name in p.lockfile['default']
assert p.lockfile['default'][transitive_pkg_name]['version'] == transitive_pkg_pinned_version

0 comments on commit a25cfa7

Please sign in to comment.