Update the test for the creating source feature to add arguments.

This commit is contained in:
2023-11-09 22:06:17 +02:00
parent befdc9ea93
commit d3bc4bd5a2
2 changed files with 14 additions and 5 deletions
+5 -4
View File
@@ -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 |
+9 -1
View File
@@ -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