summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2012-09-14 17:38:55 +0300
committerGuido Günther <agx@sigxcpu.org>2012-11-07 21:07:21 +0100
commitba854d88c5455ff7b1abab92c1d685d50855991d (patch)
tree2ab1fd6151e3b2268febf2ddecb5920eb5dbfcd9 /tests
parent8bb62f570a35bd54eb04cb7bc13d3c2dcf385ffb (diff)
GitRepository/diff: add 'paths' argument
Makes the diff function more versatile. I.e. makes diffing only certain paths possible. Also, add basic unittests for the diff() method. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_GitRepository.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_GitRepository.py b/tests/test_GitRepository.py
index 1b3f5b8..5b9fc92 100644
--- a/tests/test_GitRepository.py
+++ b/tests/test_GitRepository.py
@@ -410,6 +410,23 @@ def test_get_commit_info():
defaultdict(<type 'list'>, {'M': ['testfile']})
"""
+def test_diff():
+ """
+ Test git-diff
+
+ Methods tested:
+ - L{gbp.git.GitRepository.diff}
+
+ >>> import gbp.git
+ >>> repo = gbp.git.GitRepository(repo_dir)
+ >>> len(repo.diff('HEAD~1', 'HEAD')) > 3
+ True
+ >>> len(repo.diff('HEAD~1', 'HEAD', 'testfile')) > 3
+ True
+ >>> len(repo.diff('HEAD~1', 'HEAD', 'filenotexist')) == 0
+ True
+ """
+
def test_mirror_clone():
"""
Mirror a repository