|
|
|
@ -4,6 +4,7 @@ import json
|
|
|
|
|
from tui_rsync.core.components.backup_plan.application.services.backup_plan_service import BackupPlanService
|
|
|
|
|
from tui_rsync.core.components.backup_plan.domain import BackupPlan, Source, Destination
|
|
|
|
|
from tui_rsync.core.shared_kernel.components.common import UUID
|
|
|
|
|
from tui_rsync.core.shared_kernel.ports.Exceptions import CommandException
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@given('the label "{label}"')
|
|
|
|
@ -52,10 +53,13 @@ def add_backup_plan(context):
|
|
|
|
|
|
|
|
|
|
@when('I remove the backup plan with id="{backup_plan_id}"')
|
|
|
|
|
def given_existing_backup_plan_id_seed(context, backup_plan_id):
|
|
|
|
|
context.backup_plan_service = context.injector.get(BackupPlanService)
|
|
|
|
|
context.deleted_result = context.backup_plan_service.delete(UUID(backup_plan_id))
|
|
|
|
|
# TODO error value or exception?
|
|
|
|
|
context.exception_raised = not context.deleted_result
|
|
|
|
|
try:
|
|
|
|
|
context.backup_plan_service = context.injector.get(BackupPlanService)
|
|
|
|
|
context.backup_plan_service.delete(UUID(backup_plan_id))
|
|
|
|
|
except CommandException as e:
|
|
|
|
|
context.exception_raised = True
|
|
|
|
|
else:
|
|
|
|
|
context.exception_raised = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def compare_destinations(actual: list[Destination], expected: list[str]) -> bool:
|
|
|
|
|