"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/console/commands/debug/test_resolve.py" between
poetry-1.1.15.tar.gz and poetry-1.2.0.tar.gz

About: Poetry is a tool for dependency management and packaging in Python.

test_resolve.py  (poetry-1.1.15):test_resolve.py  (poetry-1.2.0)
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest import pytest
from poetry.factory import Factory from poetry.factory import Factory
from tests.helpers import get_package from tests.helpers import get_package
if TYPE_CHECKING:
from cleo.testers.command_tester import CommandTester
from tests.helpers import TestRepository
from tests.types import CommandTesterFactory
@pytest.fixture() @pytest.fixture()
def tester(command_tester_factory): def tester(command_tester_factory: CommandTesterFactory) -> CommandTester:
return command_tester_factory("debug resolve") return command_tester_factory("debug resolve")
def test_debug_resolve_gives_resolution_results(tester, repo): @pytest.fixture(autouse=True)
cachy2 = get_package("cachy", "0.2.0") def __add_packages(repo: TestRepository) -> None:
cachy2.add_dependency(Factory.create_dependency("msgpack-python", ">=0.5 <0. cachy020 = get_package("cachy", "0.2.0")
6")) cachy020.add_dependency(Factory.create_dependency("msgpack-python", ">=0.5 <
0.6"))
repo.add_package(get_package("cachy", "0.1.0")) 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("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: CommandTester):
tester.execute("cachy") tester.execute("cachy")
expected = """\ expected = """\
Resolving dependencies... Resolving dependencies...
Resolution results: Resolution results:
msgpack-python 0.5.3 msgpack-python 0.5.3
cachy 0.2.0 cachy 0.2.0
""" """
assert expected == tester.io.fetch_output() assert tester.io.fetch_output() == expected
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: CommandTest er):
tester.execute("cachy --tree") tester.execute("cachy --tree")
expected = """\ expected = """\
Resolving dependencies... Resolving dependencies...
Resolution results: Resolution results:
cachy 0.2.0 cachy 0.2.0
`-- msgpack-python >=0.5 <0.6 └── msgpack-python >=0.5 <0.6
""" """
assert expected == tester.io.fetch_output() assert tester.io.fetch_output() == expected
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: CommandTester):
tester.execute("git+https://github.com/demo/demo.git") tester.execute("git+https://github.com/demo/demo.git")
expected = """\ expected = """\
Resolving dependencies... Resolving dependencies...
Resolution results: Resolution results:
pendulum 2.0.3 pendulum 2.0.3
demo 0.1.2 demo 0.1.2
""" """
assert expected == tester.io.fetch_output() assert tester.io.fetch_output() == expected
 End of changes. 12 change blocks. 
22 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)