mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-12 17:57:43 +00:00
Add the E2E tests for the CLI interface.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
from behave import given, when, then
|
||||
|
||||
|
||||
@given('the CLI arguments are "{arguments}"')
|
||||
def given_cli_arguments(context, arguments):
|
||||
print(f"{arguments}")
|
||||
context.arguments = arguments.split()
|
||||
print(f"{context.arguments}")
|
||||
|
||||
|
||||
@when('I run the CLI')
|
||||
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 output contains "{string}"')
|
||||
def then_cli_output_contains(context, string):
|
||||
assert string in context.cli_result.stdout
|
||||
|
||||
|
||||
@then('the CLI contains the error: "{string}"')
|
||||
def then_cli_output_contains_error(context, string):
|
||||
assert string in context.cli_result.stdout
|
||||
|
||||
Reference in New Issue
Block a user