From a1391bf06a839746bd902dd7cba2c63d1e738d37 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 27 Nov 2009 11:07:26 +0100 Subject: ItemTraversal: Predicate and prune functions now provide depth information, allowing the callee to know more about its environment --- test/git/test_tree.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/git/test_tree.py') 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) -- cgit v1.2.1