diff options
Diffstat (limited to 'test/git')
-rw-r--r-- | test/git/test_base.py | 2 | ||||
-rw-r--r-- | test/git/test_commit.py | 10 | ||||
-rw-r--r-- | test/git/test_performance.py | 2 | ||||
-rw-r--r-- | test/git/test_repo.py | 4 |
4 files changed, 13 insertions, 5 deletions
diff --git a/test/git/test_base.py b/test/git/test_base.py index 48d628c3..04222e2e 100644 --- a/test/git/test_base.py +++ b/test/git/test_base.py @@ -62,7 +62,7 @@ class TestBase(object): ref_count = 0 for ref in chain(self.repo.tags, self.repo.heads): ref_count += 1 - assert isinstance(ref, refs.Ref) + assert isinstance(ref, refs.Reference) assert str(ref) == ref.name assert repr(ref) assert ref == ref diff --git a/test/git/test_commit.py b/test/git/test_commit.py index 46aff635..4e698ed0 100644 --- a/test/git/test_commit.py +++ b/test/git/test_commit.py @@ -233,3 +233,13 @@ class TestCommit(object): assert_equal(commit1, commit2) assert_not_equal(commit2, commit3) + def test_iter_parents(self): + # should return all but ourselves, even if skip is defined + c = self.repo.commit('0.1.5') + for skip in (0, 1): + piter = c.iter_parents(skip=skip) + first_parent = piter.next() + assert first_parent != c + assert first_parent == c.parents[0] + # END for each + diff --git a/test/git/test_performance.py b/test/git/test_performance.py index 96f13a2e..77567515 100644 --- a/test/git/test_performance.py +++ b/test/git/test_performance.py @@ -21,7 +21,7 @@ class TestPerformance(object): # return quite a lot of commits, we just take one and hence abort the operation st = time() - for c in self.repo.commits(): + for c in self.repo.iter_commits('0.1.6'): num_commits += 1 c.author c.authored_date diff --git a/test/git/test_repo.py b/test/git/test_repo.py index 24a13ed1..5869fb6a 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -42,7 +42,7 @@ class TestRepo(object): def test_commits(self, git): git.return_value = ListProcessAdapter(fixture('rev_list')) - commits = self.repo.commits('master', max_count=10) + commits = list( self.repo.iter_commits('master', max_count=10) ) c = commits[0] assert_equal('4c8124ffcf4039d292442eeccabdeca5af5c5017', c.id) @@ -73,8 +73,6 @@ class TestRepo(object): assert_equal("4c8124ffcf4039d292442eeccabdeca5af5c5017", commit.id) - assert_true(git.called) - @patch_object(Repo, '__init__') @patch_object(Git, '_call_process') def test_init_bare(self, git, repo): |