Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ytausch committed Nov 25, 2024
1 parent 1f863eb commit cb5edda
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,34 @@ def test_cli_mock_commands_pass_context(


@pytest.mark.parametrize("job, n_jobs", [(1, 5), (3, 7), (4, 4)])
@pytest.mark.parametrize("package", ["foo", "bar", "baz"])
@pytest.mark.parametrize("feedstock", ["foo", "bar"])
@mock.patch("conda_forge_tick.update_upstream_versions.main")
def test_cli_mock_update_upstream_versions(
cmd_mock: MagicMock, job: int, n_jobs: int, package: str
cmd_mock: MagicMock, job: int, n_jobs: int, feedstock: str
):
runner = CliRunner()
result = runner.invoke(
main,
["update-upstream-versions", f"--job={job}", f"--n-jobs={n_jobs}", package],
["update-upstream-versions", f"--job={job}", f"--n-jobs={n_jobs}", feedstock],
)

assert result.exit_code == 0
cmd_mock.assert_called_once_with(mock.ANY, job=job, n_jobs=n_jobs, package=package)
cmd_mock.assert_called_once_with(
mock.ANY, job=job, n_jobs=n_jobs, feedstock=feedstock
)


@pytest.mark.parametrize("feedstock", ["foo", "bar"])
@mock.patch("conda_forge_tick.auto_tick.main")
def test_cli_mock_auto_tick(cmd_mock: MagicMock, feedstock: str):
runner = CliRunner()
result = runner.invoke(
main,
["update-upstream-versions", feedstock],
)

assert result.exit_code == 0
cmd_mock.assert_called_once_with(mock.ANY, feedstock=feedstock)


@pytest.mark.parametrize("job, n_jobs", [(1, 5), (3, 7), (4, 4)])
Expand Down

0 comments on commit cb5edda

Please sign in to comment.