diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-09 13:15:09 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-09 13:17:04 +0100 |
commit | 0d9f1495004710b77767393a29f33df76d7b0fb5 (patch) | |
tree | 85a1ec9278c856bd2d19664cdf159b720d03b899 /git/test/test_diff.py | |
parent | 17f5d13a7a741dcbb2a30e147bdafe929cff4697 (diff) | |
download | gitpython-0d9f1495004710b77767393a29f33df76d7b0fb5.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.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/git/test/test_diff.py b/git/test/test_diff.py index ce0f64f2..ebf9527a 100644 --- a/git/test/test_diff.py +++ b/git/test/test_diff.py @@ -65,6 +65,16 @@ class TestDiff(TestBase): assert diff.rename_to == 'that' assert len(list(diffs.iter_change_type('R'))) == 1 + def test_binary_diff(self): + for method, file_name in ((Diff._index_from_patch_format, 'diff_patch_binary'), + (Diff._index_from_raw_format, 'diff_raw_binary')): + res = method(None, StringProcessAdapter(fixture(file_name)).stdout) + assert len(res) == 1 + 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" + # end for each method to test + 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 |