Skip to content

Commit 38c624f

Browse files
thetwojByron
authored andcommitted
Adding assertions to existing test case to cover this change
1 parent 14d7034 commit 38c624f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: git/test/test_diff.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ def test_diff_with_staged_file(self, rw_dir):
6868

6969
with open(fp, 'w') as fs:
7070
fs.write("Hola Mundo")
71-
r.git.commit(all=True, message="change on master")
71+
r.git.add(Git.polish_url(fp))
72+
self.assertEqual(len(r.index.diff("HEAD", create_patch=True)), 1,
73+
"create_patch should generate patch of diff to HEAD")
74+
r.git.commit(message="change on master")
75+
self.assertEqual(len(r.index.diff("HEAD", create_patch=True)), 0,
76+
"create_patch should generate no patch, already on HEAD")
7277

7378
r.git.checkout('HEAD~1', b='topic')
7479
with open(fp, 'w') as fs:

0 commit comments

Comments
 (0)