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

dev
KKlochko 2 years ago
parent befdc9ea93
commit d3bc4bd5a2

@ -3,12 +3,13 @@ Feature: Creating the source
Scenario Outline: Adding an new unique source Scenario Outline: Adding an new unique source
Given the label "<label>" Given the label "<label>"
And the path "<source_path>" And the path "<source_path>"
And the arguments "<arguments>"
When I add the source When I add the source
Then the source should be added successfully Then the source should be added successfully
Examples: Examples:
| label | source_path | | label | source_path | arguments |
| usb | /mnt/usb | | usb | /mnt/usb | <empty> |
| db | /db | | db | /db | -avuP |
| temp | /tmp | | temp | /tmp | -avuP --delete |

@ -12,6 +12,13 @@ def given_source_label(context, label):
def given_source_path(context, source_path): def given_source_path(context, source_path):
context.source_path = 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') @when('I add the source')
def add_source(context): def add_source(context):
try: try:
@ -19,7 +26,7 @@ def add_source(context):
context.label, context.label,
context.source_path, context.source_path,
[], [],
"", context.args,
) )
except IntegrityError: except IntegrityError:
context.exception_raised = True context.exception_raised = True
@ -32,4 +39,5 @@ def path_has_added(context):
assert context.source.label == context.label assert context.source.label == context.label
assert context.source.source.path == context.source_path assert context.source.source.path == context.source_path
assert context.source.args.command == context.args

Loading…
Cancel
Save