summaryrefslogtreecommitdiff
path: root/test/git/test_commit.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-15 18:07:04 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-15 18:07:04 +0200
commitf2df1f56cccab13d5c92abbc6b18be725e7b4833 (patch)
tree3e3760e5b46095458cf75446330ba2fc25fa23e5 /test/git/test_commit.py
parent58d692e2a1d7e3894dbed68efbcf7166d6ec3fb7 (diff)
parentb67bd4c730273a9b6cce49a8444fb54e654de540 (diff)
downloadgitpython-f2df1f56cccab13d5c92abbc6b18be725e7b4833.tar.gz
Merge branch 'repo_interface' into improvements
* repo_interface: Improved archive function by allowing it to directly write to an output stream - previously it would cache everything to memory and try to provide zipping functionality itself repo: made init and clone methods less specific, previously they wanted to do it 'barely' only. New method names closely follow the default git command names repo.commit_delta_base: removed Object can now create objects of the proper type in case one attempts to create an object directly - this feature is used in several places now, allowing for additional type-checking repo: removed commits_between but added a note about how this can be achieved using the iter_commits method; reorganized methods within the type as a start for more interface changes Added Commit.iter_parents to iterate all parents repo: removed a few methods because of redundancy or because it will be obsolete once the interface overhaul is finished. This commit is just intermediate
Diffstat (limited to 'test/git/test_commit.py')
-rw-r--r--test/git/test_commit.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/git/test_commit.py b/test/git/test_commit.py
index a95fb675..4e698ed0 100644
--- a/test/git/test_commit.py
+++ b/test/git/test_commit.py
@@ -215,6 +215,9 @@ class TestCommit(object):
for sha1, commit in zip(expected_ids, commits):
assert_equal(sha1, commit.id)
+ def test_count(self):
+ assert Commit.count( self.repo, '0.1.5' ) == 141
+
def test_str(self):
commit = Commit(self.repo, id='abc')
assert_equal ("abc", str(commit))
@@ -230,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
+