mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-09-09 06:57:44 +00:00
Add tests to check responses for showing and deleting a backup plan.
This commit is contained in:
@@ -28,6 +28,22 @@ Feature: Deleting a backup plan with the CLI
|
|||||||
| arguments | result | result_error | description |
|
| arguments | result | result_error | description |
|
||||||
| plans remove one -i 8aa59e7e-dc75-459b-aeb5-b710b39be583 | error | [ERROR] Failed to delete the backup plan, because it doesn't exist. | delete a non-existing plan |
|
| plans remove one -i 8aa59e7e-dc75-459b-aeb5-b710b39be583 | error | [ERROR] Failed to delete the backup plan, because it doesn't exist. | delete a non-existing plan |
|
||||||
|
|
||||||
|
@fixture.injector
|
||||||
|
@fixture.in_memory_database
|
||||||
|
@fixture.seeds
|
||||||
|
@fixture.cli
|
||||||
|
Scenario Outline: Response of deleting existing backup plans with the CLI
|
||||||
|
Given the CLI arguments are "<arguments>"
|
||||||
|
And I have a backup plan with id="<existing_backup_plan_id>"
|
||||||
|
When I run the CLI
|
||||||
|
Then the CLI executed with "<result>"
|
||||||
|
And the CLI output contains "<result_message>"
|
||||||
|
And the CLI output contains "<existing_backup_plan_id>"
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
| arguments | existing_backup_plan_id | result | result_message | description |
|
||||||
|
| plans remove one -i 8aa59e7e-dc75-459b-aeb5-b710b39be583 | 8aa59e7e-dc75-459b-aeb5-b710b39be583 | success | Removed the backup plan with | delete the backup plan |
|
||||||
|
|
||||||
@fixture.injector
|
@fixture.injector
|
||||||
@fixture.in_memory_database
|
@fixture.in_memory_database
|
||||||
@fixture.cli
|
@fixture.cli
|
||||||
|
|||||||
@@ -15,6 +15,22 @@ Feature: Show a backup plan with the CLI
|
|||||||
| plans show one -i 8aa59e7e-dc75-459b-beb5-b710b39be583 | 8aa59e7e-dc75-459b-beb5-b710b39be583 | success | show an existing plan |
|
| plans show one -i 8aa59e7e-dc75-459b-beb5-b710b39be583 | 8aa59e7e-dc75-459b-beb5-b710b39be583 | success | show an existing plan |
|
||||||
| plans show one -i 8aa59e7e-dc75-459b-aeb5-b710b39be583 | 8aa59e7e-dc75-459b-beb5-b710b39be512 | error | show a non-existing plan |
|
| plans show one -i 8aa59e7e-dc75-459b-aeb5-b710b39be583 | 8aa59e7e-dc75-459b-beb5-b710b39be512 | error | show a non-existing plan |
|
||||||
|
|
||||||
|
@fixture.injector
|
||||||
|
@fixture.in_memory_database
|
||||||
|
@fixture.seeds
|
||||||
|
@fixture.cli
|
||||||
|
Scenario Outline: Response of showing existing backup plans with the CLI
|
||||||
|
Given the CLI arguments are "<arguments>"
|
||||||
|
And I have a backup plan with id="<existing_backup_plan_id>"
|
||||||
|
When I run the CLI
|
||||||
|
Then the CLI executed with "<result>"
|
||||||
|
And the CLI output doesn't contains "<result_message>"
|
||||||
|
And the CLI output contains "<existing_backup_plan_id>"
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
| arguments | existing_backup_plan_id | result | result_message | description |
|
||||||
|
| plans show one -i 8aa59e7e-dc75-459b-aeb5-b710b39be583 | 8aa59e7e-dc75-459b-aeb5-b710b39be583 | success | Removed the backup plan with | delete the backup plan |
|
||||||
|
|
||||||
@fixture.injector
|
@fixture.injector
|
||||||
@fixture.in_memory_database
|
@fixture.in_memory_database
|
||||||
@fixture.cli
|
@fixture.cli
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ def then_cli_output_contains(context, string):
|
|||||||
print(f"Got: {context.cli_result.stdout}")
|
print(f"Got: {context.cli_result.stdout}")
|
||||||
assert not (string in context.cli_result.stdout)
|
assert not (string in context.cli_result.stdout)
|
||||||
|
|
||||||
|
|
||||||
@then('the CLI contains the error: "{string}"')
|
@then('the CLI contains the error: "{string}"')
|
||||||
def then_cli_output_contains_error(context, string):
|
def then_cli_output_contains_error(context, string):
|
||||||
print(f"Got: {context.cli_result.stdout}")
|
print(f"Got: {context.cli_result.stdout}")
|
||||||
|
|||||||
Reference in New Issue
Block a user