mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-12 17:57:43 +00:00
Update the test for the creating source feature to add arguments.
This commit is contained in:
@@ -3,12 +3,13 @@ Feature: Creating the source
|
||||
Scenario Outline: Adding an new unique source
|
||||
Given the label "<label>"
|
||||
And the path "<source_path>"
|
||||
And the arguments "<arguments>"
|
||||
When I add the source
|
||||
Then the source should be added successfully
|
||||
|
||||
Examples:
|
||||
| label | source_path |
|
||||
| usb | /mnt/usb |
|
||||
| db | /db |
|
||||
| temp | /tmp |
|
||||
| label | source_path | arguments |
|
||||
| usb | /mnt/usb | <empty> |
|
||||
| db | /db | -avuP |
|
||||
| temp | /tmp | -avuP --delete |
|
||||
|
||||
|
||||
@@ -12,6 +12,13 @@ def given_source_label(context, label):
|
||||
def given_source_path(context, source_path):
|
||||
context.source_path = source_path
|
||||
|
||||
@given('the arguments "{arguments}"')
|
||||
def given_source_arguments(context, arguments):
|
||||
context.args = arguments
|
||||
|
||||
if arguments == "<empty>":
|
||||
context.args = ""
|
||||
|
||||
@when('I add the source')
|
||||
def add_source(context):
|
||||
try:
|
||||
@@ -19,7 +26,7 @@ def add_source(context):
|
||||
context.label,
|
||||
context.source_path,
|
||||
[],
|
||||
"",
|
||||
context.args,
|
||||
)
|
||||
except IntegrityError:
|
||||
context.exception_raised = True
|
||||
@@ -32,4 +39,5 @@ def path_has_added(context):
|
||||
|
||||
assert context.source.label == context.label
|
||||
assert context.source.source.path == context.source_path
|
||||
assert context.source.args.command == context.args
|
||||
|
||||
|
||||
Reference in New Issue
Block a user