summaryrefslogtreecommitdiff
path: root/test/git/test_tree.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-11-27 11:07:26 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-11-27 11:22:40 +0100
commita1391bf06a839746bd902dd7cba2c63d1e738d37 (patch)
treeeb2b4913633127d939ee17908218b4c4097367e0 /test/git/test_tree.py
parentf28a2041f707986b65dbcdb4bb363bb39e4b3f77 (diff)
downloadgitpython-a1391bf06a839746bd902dd7cba2c63d1e738d37.tar.gz
ItemTraversal: Predicate and prune functions now provide depth information, allowing the callee to know more about its environment
Diffstat (limited to 'test/git/test_tree.py')
-rw-r--r--test/git/test_tree.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/git/test_tree.py b/test/git/test_tree.py
index 2bfd9922..0bb9647f 100644
--- a/test/git/test_tree.py
+++ b/test/git/test_tree.py
@@ -32,12 +32,12 @@ class TestTree(TestCase):
assert len(list(root)) == len(list(root.traverse(depth=1)))
# only choose trees
- trees_only = lambda i: i.type == "tree"
+ trees_only = lambda i,d: i.type == "tree"
trees = list(root.traverse(predicate = trees_only))
- assert len(trees) == len(list( i for i in root.traverse() if trees_only(i) ))
+ assert len(trees) == len(list( i for i in root.traverse() if trees_only(i,0) ))
# test prune
- lib_folder = lambda t: t.path == "lib"
+ lib_folder = lambda t,d: t.path == "lib"
pruned_trees = list(root.traverse(predicate = trees_only,prune = lib_folder))
assert len(pruned_trees) < len(trees)