summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-08 21:46:36 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-08 22:59:54 +0200
commitac13dbce276f81b5839987140cdd8db3d15d42a1 (patch)
tree7f31c2d7e5764bb7af6316ba6037caeb77fba5d7
parent19533ffadbcc959f12bf51488cf66f0715bec4c1 (diff)
downloadgitpython-ac13dbce276f81b5839987140cdd8db3d15d42a1.tar.gz
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
-rw-r--r--test/git/test_repo.py72
1 files changed, 3 insertions, 69 deletions
diff --git a/test/git/test_repo.py b/test/git/test_repo.py
index 6b82d029..82f27001 100644
--- a/test/git/test_repo.py
+++ b/test/git/test_repo.py
@@ -185,7 +185,7 @@ class TestRepo(object):
assert_equal(git.call_args, (('diff', 'master^', 'master', '--', 'foo/bar', 'foo/baz'), {}))
@patch_object(Git, '_call_process')
- def test_diff(self, git):
+ def test_diff_with_parents(self, git):
git.return_value = fixture('diff_p')
diffs = self.repo.commit_diff('master')
@@ -193,10 +193,10 @@ class TestRepo(object):
assert_true(git.called)
def test_archive_tar(self):
- self.repo.archive_tar
+ self.repo.archive_tar()
def test_archive_tar_gz(self):
- self.repo.archive_tar_gz
+ self.repo.archive_tar_gz()
@patch('git.utils.touch')
def test_enable_daemon_serve(self, touch):
@@ -207,19 +207,6 @@ class TestRepo(object):
self.repo.daemon_serve = True
assert_true(self.repo.daemon_serve)
- # @patch_object(os.path, 'exists')
- # @patch_object('__builtin__', 'open')
- # def test_alternates_with_two_alternates(self, exists, read):
- # # File.expects(:exist?).with("#{absolute_project_path}/.git/objects/info/alternates").returns(true)
- # # File.expects(:read).returns("/path/to/repo1/.git/objects\n/path/to/repo2.git/objects\n")
- # exists.return_value = True
- # read.return_value = ("/path/to/repo1/.git/objects\n/path/to/repo2.git/objects\n")
- #
- # assert_equal(["/path/to/repo1/.git/objects", "/path/to/repo2.git/objects"], self.repo.alternates)
- #
- # assert_true(exists.called)
- # assert_true(read.called)
- #
@patch_object(os.path, 'exists')
def test_alternates_no_file(self, os):
os.return_value = False
@@ -227,32 +214,6 @@ class TestRepo(object):
assert_true(os.called)
- # @patch_object(os.path, 'exists')
- # def test_alternates_setter_ok(self, os):
- # os.return_value = True
- # alts = ['/path/to/repo.git/objects', '/path/to/repo2.git/objects']
- #
- # # File.any_instance.expects(:write).with(alts.join("\n"))
- #
- # self.repo.alternates = alts
- #
- # assert_true(os.called)
- # # assert_equal(os.call_args, ((alts,), {}))
- # # for alt in alts:
- #
- # @patch_object(os.path, 'exists')
- # @raises(NoSuchPathError)
- # def test_alternates_setter_bad(self, os):
- # os.return_value = False
- #
- # alts = ['/path/to/repo.git/objects']
- # # File.any_instance.expects(:write).never
- # self.repo.alternates = alts
- #
- # for alt in alts:
- # assert_true(os.called)
- # assert_equal(os.call_args, (alt, {}))
-
@patch_object(os, 'remove')
def test_alternates_setter_empty(self, os):
self.repo.alternates = []
@@ -278,33 +239,6 @@ class TestRepo(object):
assert_true(git.called)
assert_equal(git.call_args, (('log', 'master', '--', 'file.rb'), {'pretty': 'raw', 'max_count': 1}))
- # @patch_object(Git, '_call_process')
- # @patch_object(Git, '_call_process')
- # def test_commit_deltas_from_nothing_new(self, gitb, gita):
- # gitb.return_value = fixture("rev_list_delta_b")
- # gita.return_value = fixture("rev_list_delta_a")
- # other_repo = Repo(GIT_REPO)
- # # self.repo.git.expects(:rev_list).with({}, "master").returns(fixture("rev_list_delta_b"))
- # # other_repo.git.expects(:rev_list).with({}, "master").returns(fixture("rev_list_delta_a"))
- #
- # delta_commits = self.repo.commit_deltas_from(other_repo)
- # assert_equal(0, len(delta_commits))
- # assert_true(gitb.called)
- # assert_equal(gitb.call_args, (('rev_list', 'master'), {}))
- # assert_true(gita.called)
- # assert_equal(gita.call_args, (('rev_list', 'master'), {}))
- #
- # def test_commit_deltas_from_when_other_has_new(self):
- # other_repo = Repo(GIT_REPO)
- # # self.repo.git.expects(:rev_list).with({}, "master").returns(fixture("rev_list_delta_a"))
- # # other_repo.git.expects(:rev_list).with({}, "master").returns(fixture("rev_list_delta_b"))
- # # for ref in ['4c8124ffcf4039d292442eeccabdeca5af5c5017',
- # # '634396b2f541a9f2d58b00be1a07f0c358b999b3',
- # # 'ab25fd8483882c3bda8a458ad2965d2248654335']:
- # # Commit.expects(:find_all).with(other_repo, ref, :max_count => 1).returns([stub()])
- # delta_commits = self.repo.commit_deltas_from(other_repo)
- # assert_equal(3, len(delta_commits))
-
def test_is_dirty_with_bare_repository(self):
self.repo.bare = True
assert_false(self.repo.is_dirty)