Skip to content

Commit

Permalink
Test with mocking that run command tries to start up server
Browse files Browse the repository at this point in the history
  • Loading branch information
juhoinkinen committed Apr 5, 2024
1 parent a0a7246 commit f12ca5e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,15 @@ def test_version_option():
assert result.output.strip() == version.strip()


def test_run():
@mock.patch("connexion.FlaskApp.run")
def test_run(run):
result = runner.invoke(annif.cli.cli, ["run"])
assert not result.exception
assert result.exit_code == 0
assert run.called


def test_run_help():
result = runner.invoke(annif.cli.cli, ["run", "--help"])
assert not result.exception
assert result.exit_code == 0
Expand Down

0 comments on commit f12ca5e

Please sign in to comment.