Skip to content

Commit

Permalink
Merge pull request #7876 from pfmoore/new_resolver_tests
Browse files Browse the repository at this point in the history
Add some functional tests for the new resolver
  • Loading branch information
pfmoore authored Mar 20, 2020
2 parents 104b665 + 0b1306b commit f6b5b40
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions tests/functional/test_new_resolver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import json

from tests.lib import create_basic_wheel_for_package


def assert_installed(script, **kwargs):
ret = script.pip('list', '--format=json')
installed = set(
(val['name'], val['version'])
for val in json.loads(ret.stdout)
)
assert set(kwargs.items()) <= installed


def test_new_resolver_can_install(script):
create_basic_wheel_for_package(
script,
"simple",
"0.1.0",
)
script.pip(
"install", "--unstable-feature=resolver",
"--no-cache-dir", "--no-index",
"--find-links", script.scratch_path,
"simple"
)
assert_installed(script, simple="0.1.0")


def test_new_resolver_can_install_with_version(script):
create_basic_wheel_for_package(
script,
"simple",
"0.1.0",
)
script.pip(
"install", "--unstable-feature=resolver",
"--no-cache-dir", "--no-index",
"--find-links", script.scratch_path,
"simple==0.1.0"
)
assert_installed(script, simple="0.1.0")


def test_new_resolver_picks_latest_version(script):
create_basic_wheel_for_package(
script,
"simple",
"0.1.0",
)
create_basic_wheel_for_package(
script,
"simple",
"0.2.0",
)
script.pip(
"install", "--unstable-feature=resolver",
"--no-cache-dir", "--no-index",
"--find-links", script.scratch_path,
"simple"
)
assert_installed(script, simple="0.2.0")


def test_new_resolver_installs_dependencies(script):
create_basic_wheel_for_package(
script,
"base",
"0.1.0",
depends=["dep"],
)
create_basic_wheel_for_package(
script,
"dep",
"0.1.0",
)
script.pip(
"install", "--unstable-feature=resolver",
"--no-cache-dir", "--no-index",
"--find-links", script.scratch_path,
"base"
)
assert_installed(script, base="0.1.0", dep="0.1.0")

0 comments on commit f6b5b40

Please sign in to comment.