summaryrefslogtreecommitdiff
path: root/test/git/test_blob.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-07-26 14:46:05 +0200
committerMichael Trier <mtrier@gmail.com>2008-07-28 00:33:02 -0400
commit14cef2bb3e0de02f306fa37c268d6c276326c002 (patch)
treee91fb271de73f006a160fcaea928cd266efb07db /test/git/test_blob.py
parentd3ce120c9acc7d9d4ce86aa1f07b027d1c45a9a1 (diff)
downloadgitpython-14cef2bb3e0de02f306fa37c268d6c276326c002.tar.gz
Avoid stripping newlines in blob data.
(cherry picked from commit ccca12ee26e40fb4c4df2d77154ed496144569b9)
Diffstat (limited to 'test/git/test_blob.py')
-rw-r--r--test/git/test_blob.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/git/test_blob.py b/test/git/test_blob.py
index 68afdbd8..c4d8036c 100644
--- a/test/git/test_blob.py
+++ b/test/git/test_blob.py
@@ -18,7 +18,15 @@ class TestBlob(object):
blob = Blob(self.repo, **{'id': 'abc'})
assert_equal("Hello world", blob.data)
assert_true(git.called)
- assert_equal(git.call_args, (('cat_file', 'abc'), {'p': True}))
+ assert_equal(git.call_args, (('cat_file', 'abc'), {'p': True, 'with_raw_output': True}))
+
+ @patch(Git, '_call_process')
+ def test_should_return_blob_contents_with_newline(self, git):
+ git.return_value = fixture('cat_file_blob_nl')
+ blob = Blob(self.repo, **{'id': 'abc'})
+ assert_equal("Hello world\n", blob.data)
+ assert_true(git.called)
+ assert_equal(git.call_args, (('cat_file', 'abc'), {'p': True, 'with_raw_output': True}))
@patch(Git, '_call_process')
def test_should_cache_data(self, git):
@@ -28,7 +36,7 @@ class TestBlob(object):
blob.data
assert_true(git.called)
assert_equal(git.call_count, 1)
- assert_equal(git.call_args, (('cat_file', 'abc'), {'p': True}))
+ assert_equal(git.call_args, (('cat_file', 'abc'), {'p': True, 'with_raw_output': True}))
@patch(Git, '_call_process')
def test_should_return_file_size(self, git):