summaryrefslogtreecommitdiff
path: root/git/test/test_diff.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-09 13:15:09 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-09 17:16:35 +0100
commit18caa610d50b92331485013584f5373804dd0416 (patch)
tree4ff1e44d7451a99d10ea1d2acf78764698c16229 /git/test/test_diff.py
parent0d9f1495004710b77767393a29f33df76d7b0fb5 (diff)
downloadgitpython-18caa610d50b92331485013584f5373804dd0416.tar.gz
Added test to verify binary diffs are working as well.
Related to #74
Diffstat (limited to 'git/test/test_diff.py')
-rw-r--r--git/test/test_diff.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/git/test/test_diff.py b/git/test/test_diff.py
index ebf9527a..c59117ef 100644
--- a/git/test/test_diff.py
+++ b/git/test/test_diff.py
@@ -73,8 +73,20 @@ class TestDiff(TestBase):
assert len(list(res.iter_change_type('M'))) == 1
if res[0].diff:
assert res[0].diff == "Binary files a/rps and b/rps differ\n", "in patch mode, we get a diff text"
+ assert isinstance(str(res[0]), str), "This call should just work"
# end for each method to test
+ def test_diff_index(self):
+ output = StringProcessAdapter(fixture('diff_index_patch'))
+ res = Diff._index_from_patch_format(None, output.stdout)
+ assert len(res) == 6
+ for dr in res:
+ assert dr.diff
+ # end for each diff
+
+ dr = res[3]
+ assert dr.diff.endswith("+Binary files a/rps and b/rps differ\n")
+
def test_diff_patch_format(self):
# test all of the 'old' format diffs for completness - it should at least
# be able to deal with it