From f9ca26405c53a6ad829e1bcf4f60c5a6bb4ae4d9 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Tue, 27 Dec 2011 18:09:11 +0100 Subject: GitRepository: Add num option to git_commits to limit number of returned commits and fix path option to also accept a list of paths instead of a string. --- tests/test_GitRepository.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') diff --git a/tests/test_GitRepository.py b/tests/test_GitRepository.py index 6bf40ee8..8ba75e17 100644 --- a/tests/test_GitRepository.py +++ b/tests/test_GitRepository.py @@ -255,6 +255,25 @@ def test_list_files(): [] """ +def test_get_commits(): + """ + Test listing commits + + Methods tested: + - L{gbp.git.GitRepository.get_commits} + + >>> import gbp.git + >>> repo = gbp.git.GitRepository(repo_dir) + >>> commits = repo.get_commits() + >>> type(commits) == list and len(commits) == 2 + True + >>> len(repo.get_commits(num=1)) == 1 + True + >>> repo.get_commits(paths=['foo', 'bar']) + [] + >>> repo.get_commits(paths=['testfile']) == commits + True + """ def test_mirror_clone(): """ -- cgit v1.2.3