visit() now returns paths in depth-first order. fixes issue #47

--HG--
branch : trunk
This commit is contained in:
holger krekel
2009-09-22 19:13:33 +02:00
parent e3b34c9da3
commit 6ddea4a1bc
3 changed files with 24 additions and 15 deletions

View File

@@ -198,6 +198,15 @@ class TestLocalPath(common.CommonFSTests):
l2 = tmpdir.join(newfilename)
assert l2.read() == 'foo'
def test_visit_depth_first(self, tmpdir):
p1 = tmpdir.ensure("a","1")
p2 = tmpdir.ensure("b","2")
p3 = tmpdir.ensure("breadth")
l = list(tmpdir.visit(lambda x: x.check(file=1)))
assert l[0] == p1
assert l[1] == p2
assert l[2] == p3
class TestExecutionOnWindows:
disabled = py.std.sys.platform != 'win32'