Skip to content

Commit ac13dbc

Browse files
committed
repo_tests: fixed duplicate test-method name which would redefine the previous one which never ran
removed old tests which were commented out test_achive* method didn't actually call the functions, but only derefenced them
1 parent 19533ff commit ac13dbc

File tree

1 file changed

+3
-69
lines changed

1 file changed

+3
-69
lines changed

test/git/test_repo.py

Lines changed: 3 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,18 @@ def test_diff(self, git):
185185
assert_equal(git.call_args, (('diff', 'master^', 'master', '--', 'foo/bar', 'foo/baz'), {}))
186186

187187
@patch_object(Git, '_call_process')
188-
def test_diff(self, git):
188+
def test_diff_with_parents(self, git):
189189
git.return_value = fixture('diff_p')
190190

191191
diffs = self.repo.commit_diff('master')
192192
assert_equal(15, len(diffs))
193193
assert_true(git.called)
194194

195195
def test_archive_tar(self):
196-
self.repo.archive_tar
196+
self.repo.archive_tar()
197197

198198
def test_archive_tar_gz(self):
199-
self.repo.archive_tar_gz
199+
self.repo.archive_tar_gz()
200200

201201
@patch('git.utils.touch')
202202
def test_enable_daemon_serve(self, touch):
@@ -207,52 +207,13 @@ def test_disable_daemon_serve(self):
207207
self.repo.daemon_serve = True
208208
assert_true(self.repo.daemon_serve)
209209

210-
# @patch_object(os.path, 'exists')
211-
# @patch_object('__builtin__', 'open')
212-
# def test_alternates_with_two_alternates(self, exists, read):
213-
# # File.expects(:exist?).with("#{absolute_project_path}/.git/objects/info/alternates").returns(true)
214-
# # File.expects(:read).returns("/path/to/repo1/.git/objects\n/path/to/repo2.git/objects\n")
215-
# exists.return_value = True
216-
# read.return_value = ("/path/to/repo1/.git/objects\n/path/to/repo2.git/objects\n")
217-
#
218-
# assert_equal(["/path/to/repo1/.git/objects", "/path/to/repo2.git/objects"], self.repo.alternates)
219-
#
220-
# assert_true(exists.called)
221-
# assert_true(read.called)
222-
#
223210
@patch_object(os.path, 'exists')
224211
def test_alternates_no_file(self, os):
225212
os.return_value = False
226213
assert_equal([], self.repo.alternates)
227214

228215
assert_true(os.called)
229216

230-
# @patch_object(os.path, 'exists')
231-
# def test_alternates_setter_ok(self, os):
232-
# os.return_value = True
233-
# alts = ['/path/to/repo.git/objects', '/path/to/repo2.git/objects']
234-
#
235-
# # File.any_instance.expects(:write).with(alts.join("\n"))
236-
#
237-
# self.repo.alternates = alts
238-
#
239-
# assert_true(os.called)
240-
# # assert_equal(os.call_args, ((alts,), {}))
241-
# # for alt in alts:
242-
#
243-
# @patch_object(os.path, 'exists')
244-
# @raises(NoSuchPathError)
245-
# def test_alternates_setter_bad(self, os):
246-
# os.return_value = False
247-
#
248-
# alts = ['/path/to/repo.git/objects']
249-
# # File.any_instance.expects(:write).never
250-
# self.repo.alternates = alts
251-
#
252-
# for alt in alts:
253-
# assert_true(os.called)
254-
# assert_equal(os.call_args, (alt, {}))
255-
256217
@patch_object(os, 'remove')
257218
def test_alternates_setter_empty(self, os):
258219
self.repo.alternates = []
@@ -278,33 +239,6 @@ def test_log_with_path_and_options(self, git):
278239
assert_true(git.called)
279240
assert_equal(git.call_args, (('log', 'master', '--', 'file.rb'), {'pretty': 'raw', 'max_count': 1}))
280241

281-
# @patch_object(Git, '_call_process')
282-
# @patch_object(Git, '_call_process')
283-
# def test_commit_deltas_from_nothing_new(self, gitb, gita):
284-
# gitb.return_value = fixture("rev_list_delta_b")
285-
# gita.return_value = fixture("rev_list_delta_a")
286-
# other_repo = Repo(GIT_REPO)
287-
# # self.repo.git.expects(:rev_list).with({}, "master").returns(fixture("rev_list_delta_b"))
288-
# # other_repo.git.expects(:rev_list).with({}, "master").returns(fixture("rev_list_delta_a"))
289-
#
290-
# delta_commits = self.repo.commit_deltas_from(other_repo)
291-
# assert_equal(0, len(delta_commits))
292-
# assert_true(gitb.called)
293-
# assert_equal(gitb.call_args, (('rev_list', 'master'), {}))
294-
# assert_true(gita.called)
295-
# assert_equal(gita.call_args, (('rev_list', 'master'), {}))
296-
#
297-
# def test_commit_deltas_from_when_other_has_new(self):
298-
# other_repo = Repo(GIT_REPO)
299-
# # self.repo.git.expects(:rev_list).with({}, "master").returns(fixture("rev_list_delta_a"))
300-
# # other_repo.git.expects(:rev_list).with({}, "master").returns(fixture("rev_list_delta_b"))
301-
# # for ref in ['4c8124ffcf4039d292442eeccabdeca5af5c5017',
302-
# # '634396b2f541a9f2d58b00be1a07f0c358b999b3',
303-
# # 'ab25fd8483882c3bda8a458ad2965d2248654335']:
304-
# # Commit.expects(:find_all).with(other_repo, ref, :max_count => 1).returns([stub()])
305-
# delta_commits = self.repo.commit_deltas_from(other_repo)
306-
# assert_equal(3, len(delta_commits))
307-
308242
def test_is_dirty_with_bare_repository(self):
309243
self.repo.bare = True
310244
assert_false(self.repo.is_dirty)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy