From 9ce1193c851e98293a237ad3d2d87725c501e89f Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 15 Oct 2009 14:11:34 +0200 Subject: Added Commit.iter_parents to iterate all parents Renamed Commit.commits to iter_commits repo: assured proper use of the terms revision ( rev ) and reference ( ref ) --- test/git/test_commit.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/git/test_commit.py') 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 + -- cgit v1.2.1