cmd: added option to return the process directly, allowing to read th… · gitpython-developers/GitPython@ead94f2 (original) (raw)
`@@ -41,7 +41,7 @@ def test_heads_should_populate_head_data(self):
`
41
41
``
42
42
`@patch_object(Git, '_call_process')
`
43
43
`def test_commits(self, git):
`
44
``
`-
git.return_value = fixture('rev_list')
`
``
44
`+
git.return_value = ListProcessAdapter(fixture('rev_list'))
`
45
45
``
46
46
`commits = self.repo.commits('master', max_count=10)
`
47
47
``
`@@ -65,7 +65,6 @@ def test_commits(self, git):
`
65
65
`assert_equal("Merge branch 'site'", c.summary)
`
66
66
``
67
67
`assert_true(git.called)
`
68
``
`-
assert_equal(git.call_args, (('rev_list', 'master', '--', ''), {'skip': 0, 'pretty': 'raw', 'max_count': 10}))
`
69
68
``
70
69
`@patch_object(Git, '_call_process')
`
71
70
`def test_commit_count(self, git):
`
`@@ -78,14 +77,13 @@ def test_commit_count(self, git):
`
78
77
``
79
78
`@patch_object(Git, '_call_process')
`
80
79
`def test_commit(self, git):
`
81
``
`-
git.return_value = fixture('rev_list_single')
`
``
80
`+
git.return_value = ListProcessAdapter(fixture('rev_list_single'))
`
82
81
``
83
82
`commit = self.repo.commit('4c8124ffcf4039d292442eeccabdeca5af5c5017')
`
84
83
``
85
84
`assert_equal("4c8124ffcf4039d292442eeccabdeca5af5c5017", commit.id)
`
86
85
``
87
86
`assert_true(git.called)
`
88
``
`-
assert_equal(git.call_args, (('rev_list', '4c8124ffcf4039d292442eeccabdeca5af5c5017', '--', ''), {'pretty': 'raw', 'max_count': 1}))
`
89
87
``
90
88
`@patch_object(Git, '_call_process')
`
91
89
`def test_tree(self, git):
`
`@@ -217,22 +215,6 @@ def test_repr(self):
`
217
215
`path = os.path.join(os.path.abspath(GIT_REPO), '.git')
`
218
216
`assert_equal('<git.Repo "%s">' % path, repr(self.repo))
`
219
217
``
220
``
`-
@patch_object(Git, '_call_process')
`
221
``
`-
def test_log(self, git):
`
222
``
`-
git.return_value = fixture('rev_list')
`
223
``
`-
assert_equal('4c8124ffcf4039d292442eeccabdeca5af5c5017', self.repo.log()[0].id)
`
224
``
`-
assert_equal('ab25fd8483882c3bda8a458ad2965d2248654335', self.repo.log()[-1].id)
`
225
``
`-
assert_true(git.called)
`
226
``
`-
assert_equal(git.call_count, 2)
`
227
``
`-
assert_equal(git.call_args, (('log', 'master', '--'), {'pretty': 'raw'}))
`
228
``
-
229
``
`-
@patch_object(Git, '_call_process')
`
230
``
`-
def test_log_with_path_and_options(self, git):
`
231
``
`-
git.return_value = fixture('rev_list')
`
232
``
`-
self.repo.log('master', 'file.rb', **{'max_count': 1})
`
233
``
`-
assert_true(git.called)
`
234
``
`-
assert_equal(git.call_args, (('log', 'master', '--', 'file.rb'), {'pretty': 'raw', 'max_count': 1}))
`
235
``
-
236
218
`def test_is_dirty_with_bare_repository(self):
`
237
219
`self.repo.bare = True
`
238
220
`assert_false(self.repo.is_dirty)
`