From 14cef2bb3e0de02f306fa37c268d6c276326c002 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 26 Jul 2008 14:46:05 +0200 Subject: Avoid stripping newlines in blob data. (cherry picked from commit ccca12ee26e40fb4c4df2d77154ed496144569b9) --- test/git/test_blob.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'test/git/test_blob.py') 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): -- cgit v1.2.1