Skip to content

Commit

Permalink
Add test for update --sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Cypher1 committed Feb 5, 2024
1 parent 26e70d2 commit d84568c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/console/commands/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

if TYPE_CHECKING:
from poetry.poetry import Poetry
from pytest_mock import MockerFixture
from tests.helpers import TestRepository
from tests.types import CommandTesterFactory
from tests.types import FixtureDirGetter
Expand Down Expand Up @@ -80,3 +81,17 @@ def test_update_prints_operations(

assert ("Package operations:" in output) is expected
assert ("Installing docker (4.3.1)" in output) is expected

@pytest.fixture()
def test_update_sync_option_is_passed_to_the_installer(
mocker: MockerFixture
) -> None:
"""
The --sync option is passed properly to the installer from update.
"""
tester = command_tester_factory("update", poetry=poetry_with_outdated_lockfile)
mocker.patch.object(tester.command.installer, "run", return_value=1)

tester.execute("--sync")

assert tester.command.installer._requires_synchronization

0 comments on commit d84568c

Please sign in to comment.