diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/git/test_commit.py | 2 | ||||
-rw-r--r-- | test/git/test_repo.py | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/test/git/test_commit.py b/test/git/test_commit.py index c8bca564..abe16dfb 100644 --- a/test/git/test_commit.py +++ b/test/git/test_commit.py @@ -66,7 +66,7 @@ class TestCommit(object): assert_equal(sha1, commit.id) def test_count(self): - assert Commit.count( self.repo, '0.1.5' ) == 141 + assert self.repo.tag('0.1.5').commit.count( ) == 141 def test_str(self): commit = Commit(self.repo, id='abc') diff --git a/test/git/test_repo.py b/test/git/test_repo.py index 0d8a473d..197a29cb 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -67,6 +67,16 @@ class TestRepo(TestCase): assert_true(git.called) + def test_trees(self): + mc = 30 + num_trees = 0 + for tree in self.repo.iter_trees('0.1.5', max_count=mc): + num_trees += 1 + assert isinstance(tree, Tree) + # END for each tree + assert num_trees == mc + + @patch_object(Repo, '__init__') @patch_object(Git, '_call_process') def test_init(self, git, repo): @@ -170,6 +180,9 @@ class TestRepo(TestCase): def test_head(self): assert self.repo.head.object == self.repo.active_branch.object + def test_tag(self): + assert self.repo.tag('0.1.5').commit + @patch_object(Git, '_call_process') def test_should_display_blame_information(self, git): git.return_value = fixture('blame') |