Update to step to test the result of CLI execution.

This commit is contained in:
2025-01-25 21:43:27 +02:00
parent add3c3d59e
commit 5e606b0e83
3 changed files with 13 additions and 28 deletions
+7 -8
View File
@@ -13,14 +13,13 @@ def when_run_cli(context):
context.cli_result = context.cli_runner.invoke(context.cli_app, context.arguments)
@then('the CLI executed successfully')
def then_cli_executed_successfully(context):
assert context.cli_result.exit_code == 0
@then('the CLI executed with an error')
def then_cli_executed_with_error(context):
assert context.cli_result.exit_code == 0
@then('the CLI executed with "{result}"')
def then_cli_executed_successfully(context, result):
match result:
case "success":
assert context.cli_result.exit_code == 0
case "error":
assert context.cli_result.exit_code == 0
@then('the CLI output contains "{string}"')