mirror of https://gitlab.com/KKlochko/tui-rsync
parent
6b247fbe4e
commit
18eb9b4d91
@ -0,0 +1,15 @@
|
|||||||
|
Feature: Creating a backup plan with the CLI
|
||||||
|
|
||||||
|
@fixture.injector
|
||||||
|
@fixture.in_memory_database
|
||||||
|
@fixture.cli
|
||||||
|
Scenario Outline: Create an new unique backup plan with the CLI
|
||||||
|
Given the CLI arguments are "<arguments>"
|
||||||
|
When I run the CLI
|
||||||
|
Then the CLI executed successfully
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
| arguments |
|
||||||
|
| plans add --label my_label --source /mnt -d /mnt2 -d /mnt3 |
|
||||||
|
| plans add --label label2 --source /mnt -d /mnt2 -d /mnt3 |
|
||||||
|
|
@ -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
|
||||||
|
|
Loading…
Reference in new issue