mirror of https://gitlab.com/KKlochko/tui-rsync
parent
0abefda95a
commit
c8d2b84cfc
@ -0,0 +1,33 @@
|
||||
Feature: Creating the source
|
||||
|
||||
@fixture.in_memory_database
|
||||
@fixture.backup_plan_repository
|
||||
Scenario Outline: Create an new unique backup plan
|
||||
Given the label "<label>"
|
||||
And the path "<source_path>"
|
||||
And the destinations <destinations>
|
||||
When I create the backup plan
|
||||
Then it should be created successfully
|
||||
|
||||
Examples:
|
||||
| label | source_path | destinations |
|
||||
| usb | /mnt/usb | [] |
|
||||
| db | /db | ["/backup/db"] |
|
||||
| temp | /tmp | ["/backup/tmp1", "/backup/tmp2"] |
|
||||
|
||||
@fixture.in_memory_database
|
||||
@fixture.backup_plan_repository
|
||||
Scenario Outline: Create an new unique backup plan
|
||||
Given the label "<label>"
|
||||
And the path "<source_path>"
|
||||
And the destinations <destinations>
|
||||
When I create the backup plan
|
||||
When I delete the backup plan
|
||||
Then it should be deleted successfully
|
||||
|
||||
Examples:
|
||||
| label | source_path | destinations |
|
||||
| usb | /mnt/usb | [] |
|
||||
| db | /db | ["/backup/db"] |
|
||||
| temp | /tmp | ["/backup/tmp1", "/backup/tmp2"] |
|
||||
|
@ -1,16 +0,0 @@
|
||||
Feature: Creating the source
|
||||
|
||||
Scenario Outline: Create an new unique backup plan
|
||||
Given the label "<label>"
|
||||
And the path "<source_path>"
|
||||
And the destinations <destinations>
|
||||
And the arguments "<arguments>"
|
||||
When I create the backup plan
|
||||
Then it should be created successfully
|
||||
|
||||
Examples:
|
||||
| label | source_path | destinations | arguments |
|
||||
| usb | /mnt/usb | [] | <empty> |
|
||||
| db | /db | ["/backup/db"] | -avuP |
|
||||
| temp | /tmp | ["/backup/tmp1", "/backup/tmp2"] | -avuP --delete |
|
||||
|
@ -0,0 +1,23 @@
|
||||
from behave import fixture, use_fixture
|
||||
|
||||
from tui_rsync.core.components.backup_plan.application.repository.backup_plan_repository import BackupPlanRepository
|
||||
from tui_rsync.infrastructure.orm import InMemoryDatabaseManager
|
||||
|
||||
|
||||
@fixture
|
||||
def setup_in_memory_database_manager(context):
|
||||
context.db = InMemoryDatabaseManager()
|
||||
yield context.db
|
||||
|
||||
|
||||
@fixture
|
||||
def setup_backup_plan_repository(context):
|
||||
context.backup_plan_repository = BackupPlanRepository(context.db)
|
||||
yield context.db
|
||||
|
||||
|
||||
def before_tag(context, tag):
|
||||
if tag == "fixture.in_memory_database":
|
||||
use_fixture(setup_in_memory_database_manager, context)
|
||||
if tag == "fixture.backup_plan_repository":
|
||||
use_fixture(setup_backup_plan_repository, context)
|
Loading…
Reference in new issue