Skip to content

Commit 0f2f643

Browse files
committed
Unify patch generated step
1 parent 03845bd commit 0f2f643

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

features/diff-in-git.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Feature: Diff in git
2121
An important sentence for the README!
2222
"""
2323
When I run "dfetch diff SomeProject"
24-
Then the patch file 'MyProject/SomeProject.patch' is generated with
24+
Then the patch file 'MyProject/SomeProject.patch' is generated
2525
"""
2626
diff --git a/README.md b/README.md
2727
index 1e65bd6..faa3b21 100644
@@ -40,7 +40,7 @@ Feature: Diff in git
4040
"""
4141
And "SomeProject/IGNORE_ME.tmp" in MyProject is created
4242
When I run "dfetch diff SomeProject"
43-
Then the patch file 'MyProject/SomeProject.patch' is generated with
43+
Then the patch file 'MyProject/SomeProject.patch' is generated
4444
"""
4545
diff --git a/NEWFILE.md b/NEWFILE.md
4646
new file mode 100644
@@ -65,7 +65,7 @@ Feature: Diff in git
6565
An important sentence for the README!
6666
"""
6767
When I run "dfetch diff SomeProject"
68-
Then the patch file 'MyProject/SomeProject.patch' is generated with
68+
Then the patch file 'MyProject/SomeProject.patch' is generated
6969
"""
7070
diff --git a/README.md b/README.md
7171
index 1e65bd6..faa3b21 100644

features/diff-in-svn.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Feature: Diff in svn
4141
"""
4242
And "SomeProject/IGNORE_ME.tmp" in MySvnProject is created
4343
When I run "dfetch diff SomeProject" in MySvnProject
44-
Then the patch file 'MySvnProject/SomeProject.patch' is generated with
44+
Then the patch file 'MySvnProject/SomeProject.patch' is generated
4545
"""
4646
Index: SomeProject/NEWFILE.md
4747
===================================================================

features/steps/generic_steps.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,12 @@ def step_impl(context, name):
199199

200200

201201
@then("the patch file '{name}' is generated")
202-
def step_impl(_, name):
203-
"""Check a manifest."""
204-
check_file_exists(name)
205-
206-
207-
@then("the patch file '{name}' is generated with")
208202
def step_impl(context, name):
209-
"""Check a manifest."""
210-
check_file(name, context.text)
203+
"""Check a patch file."""
204+
if context.text:
205+
check_file(name, context.text)
206+
else:
207+
check_file_exists(name)
211208

212209

213210
@then("the '{name}' file contains")

0 commit comments

Comments
 (0)