Exemple #1
0
    def test_subdirs(self):
	os.mkdir("_test/dir")
	os.mkdir("_test/zdir")
	touch("_test/aaa")
	touch("_test/eee")
	touch("_test/dir/aa")
	children = [x for x in asure.walk("_test")]
	self.assertEqual(children,
		[('d', '.'),
		    ('d', 'dir'),
		    ('-', 'aa'),
		    ('u', 'dir'),
		    ('d', 'zdir'),
		    ('u', 'zdir'),
		    ('-', 'aaa'),
		    ('-', 'eee'),
		    ('u', '.')])
Exemple #2
0
    def test_single(self):
	touch("_test/aaaaa")
	self.assertEqual([x for x in asure.walk("_test")],
		[('d', '.'),
		    ('-', 'aaaaa'),
		    ('u', '.')])
Exemple #3
0
    def test_empty(self):
	children = [x for x in asure.walk("_test")]
	self.assertEqual(children, [('d', '.'), ('u', '.')])