diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-12-27 18:09:11 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-12-27 19:13:57 +0100 |
commit | f9ca26405c53a6ad829e1bcf4f60c5a6bb4ae4d9 (patch) | |
tree | 79113c3ae290d08f9b322ca4feb67e7bcc59fb23 /tests | |
parent | 6fc0ec045b5cb4ad01a7583481d83a8552cd76a7 (diff) |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_GitRepository.py | 19 |
1 files changed, 19 insertions, 0 deletions
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(): """ |