Skip to content

Commit

Permalink
tests: refactor fixtures for commands.debug
Browse files Browse the repository at this point in the history
Relates-to: #3155
  • Loading branch information
sanders41 authored Oct 12, 2020
1 parent d1e7602 commit d190504
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions tests/console/commands/debug/test_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ def tester(command_tester_factory):
return command_tester_factory("debug resolve")


def test_debug_resolve_gives_resolution_results(tester, repo):
cachy2 = get_package("cachy", "0.2.0")
cachy2.add_dependency(Factory.create_dependency("msgpack-python", ">=0.5 <0.6"))
@pytest.fixture(autouse=True)
def __add_packages(repo):
cachy020 = get_package("cachy", "0.2.0")
cachy020.add_dependency(Factory.create_dependency("msgpack-python", ">=0.5 <0.6"))

repo.add_package(get_package("cachy", "0.1.0"))
repo.add_package(cachy2)
repo.add_package(cachy020)
repo.add_package(get_package("msgpack-python", "0.5.3"))

repo.add_package(get_package("pendulum", "2.0.3"))
repo.add_package(get_package("cleo", "0.6.5"))


def test_debug_resolve_gives_resolution_results(tester):
tester.execute("cachy")

expected = """\
Expand All @@ -31,14 +37,7 @@ def test_debug_resolve_gives_resolution_results(tester, repo):
assert expected == tester.io.fetch_output()


def test_debug_resolve_tree_option_gives_the_dependency_tree(tester, repo):
cachy2 = get_package("cachy", "0.2.0")
cachy2.add_dependency(Factory.create_dependency("msgpack-python", ">=0.5 <0.6"))

repo.add_package(get_package("cachy", "0.1.0"))
repo.add_package(cachy2)
repo.add_package(get_package("msgpack-python", "0.5.3"))

def test_debug_resolve_tree_option_gives_the_dependency_tree(tester):
tester.execute("cachy --tree")

expected = """\
Expand All @@ -53,10 +52,7 @@ def test_debug_resolve_tree_option_gives_the_dependency_tree(tester, repo):
assert expected == tester.io.fetch_output()


def test_debug_resolve_git_dependency(tester, repo):
repo.add_package(get_package("pendulum", "2.0.3"))
repo.add_package(get_package("cleo", "0.6.5"))

def test_debug_resolve_git_dependency(tester):
tester.execute("git+https://github.com/demo/demo.git")

expected = """\
Expand Down

0 comments on commit d190504

Please sign in to comment.