13 if S_ISDIR(st
.st_mode
):
14 for child
in os
.listdir(path
):
15 rm_r(os
.path
.join(path
, child
))
21 if os
.path
.lexists(path
):
22 raise ("Name already exists: %s" % path
)
26 # Test Asure's directory scanning code.
27 class ScanUnitTest(unittest
.TestCase
):
36 children
= [x
for x
in asure
.walk("_test")]
37 self
.assertEqual(children
, [('d', '.'), ('u', '.')])
39 def test_single(self
):
41 self
.assertEqual([x
for x
in asure
.walk("_test")],
46 def test_subdirs(self
):
48 os
.mkdir("_test/zdir")
52 children
= [x
for x
in asure
.walk("_test")]
53 self
.assertEqual(children
,
64 if __name__
== '__main__':