From a16e43462ad2bef0af810eb6f62c8df58e8b65d9 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Wed, 29 Jan 2025 21:09:25 +0200 Subject: [PATCH] Add tests for the replace command. --- features/backup_plan_cli_update.feature | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 features/backup_plan_cli_update.feature diff --git a/features/backup_plan_cli_update.feature b/features/backup_plan_cli_update.feature new file mode 100644 index 0000000..ddba1d2 --- /dev/null +++ b/features/backup_plan_cli_update.feature @@ -0,0 +1,45 @@ +Feature: Update a backup plan with the CLI + + @fixture.injector + @fixture.in_memory_database + @fixture.seeds + @fixture.cli + Scenario Outline: Replace a backup plan with the CLI + Given the CLI arguments are "" + And I have a backup plan with id="" + When I run the CLI + Then the CLI executed with "" + + Examples: + | arguments | existing_backup_plan_id | result | description | + | plans update replace -i 8aa59e7e-dc75-459b-beb5-b710b39be583 -l test -s /mnt -d /mnt2 -d /mnt3 | 8aa59e7e-dc75-459b-beb5-b710b39be583 | success | replace an existing plan | + | plans update replace -i 8aa59e7e-dc75-459b-beb5-b710b39be583 -l test -s /mnt -d /mnt2 -d /mnt3 | 8aa59e7e-dc75-459b-beb5-b710b39be512 | error | replace a non-existing plan | + + @fixture.injector + @fixture.in_memory_database + @fixture.cli + Scenario Outline: Response of replace non-existing backup plans with the CLI + Given the CLI arguments are "" + When I run the CLI + Then the CLI executed with "" + And the CLI contains the error: "" + + Examples: + | arguments | result | result_error | description | + | plans update replace -i 8aa59e7e-dc75-459b-beb5-b710b39be583 -l test -s /mnt -d /mnt2 -d /mnt3 | error | [ERROR] The backup plan was not found. | replace a non-existing plan | + + @fixture.injector + @fixture.in_memory_database + @fixture.seeds + @fixture.cli + Scenario Outline: Response of replace an existing backup plans with the CLI + Given the CLI arguments are "" + And I have a backup plan with id="" + When I run the CLI + Then the CLI executed with "" + And the CLI output contains "" + + Examples: + | arguments | existing_backup_plan_id | result | result_message | description | + | plans update replace -i 8aa59e7e-dc75-459b-beb5-b710b39be583 -l test -s /mnt -d /mnt2 -d /mnt3 | 8aa59e7e-dc75-459b-beb5-b710b39be583 | success | The backup plan updated. | replace an existing plan | +