From e04b9894b98718829aceb97b893ccd63d104fcbe Mon Sep 17 00:00:00 2001 From: KKlochko Date: Mon, 6 Nov 2023 20:13:21 +0200 Subject: [PATCH] Add the check for failed adding a path, because of path uniqueness. --- features/path.feature | 5 +++++ features/steps/path_steps.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/features/path.feature b/features/path.feature index d490384..e7abf9b 100644 --- a/features/path.feature +++ b/features/path.feature @@ -5,3 +5,8 @@ Feature: Adding an unique path When I add the path to the database Then the path should be added successfully + Scenario: Adding an new path with not uniq path + Given a path "/media" + When I add the path to the database + Then the exception should occur + diff --git a/features/steps/path_steps.py b/features/steps/path_steps.py index 891a691..b5efef6 100644 --- a/features/steps/path_steps.py +++ b/features/steps/path_steps.py @@ -22,3 +22,7 @@ def path_has_added(context): assert context.path.path == context.path_str assert context.exception_raised == False +@then('the exception should occur') +def path_has_not_added(context): + assert context.exception_raised == True +