def test_dot_dot(): fr = FileRecognizer(skip_hidden_files=True, skip_hidden_dirs=True, skip_exts=set(['.skip_ext']),skip_dirs=set(['skip_dir'])) truth = [ ('../binary', 'binary'), ('../dir.skip_ext/text', 'text'), ('../dir/subdir/text', 'text'), ('../dir/text', 'text'), ('../text', 'text'), ('../text.dont_skip_ext', 'text'), ] result = sorted(fr.walk('..')) assert result == truth
def test_dot_dot(): fr = FileRecognizer(skip_hidden_files=True, skip_hidden_dirs=True, skip_exts=set(['.skip_ext']), skip_dirs=set(['skip_dir'])) truth = [ (os.path.join(os.curdir, 'binary'), 'binary'), (os.path.join(os.curdir, 'dir.skip_ext', 'text'), 'text'), (os.path.join(os.curdir, 'dir', 'subdir', 'text'), 'text'), (os.path.join(os.curdir, 'dir', 'text'), 'text'), (os.path.join(os.curdir, 'text'), 'text'), (os.path.join(os.curdir, 'text.dont_skip_ext'), 'text'), ] result = sorted(fr.walk(os.pardir)) nt.assert_equal(result, truth)
def test_walking(): fr = FileRecognizer(skip_hidden_files=True, skip_hidden_dirs=True, skip_exts=set(['.skip_ext']), skip_dirs=set(['skip_dir'])) truth = [ ('tree/binary', 'binary'), ('tree/dir.skip_ext/text', 'text'), ('tree/dir/subdir/text', 'text'), ('tree/dir/text', 'text'), ('tree/text', 'text'), ('tree/text.dont_skip_ext', 'text'), ] result = sorted(fr.walk('tree')) nt.assert_equal(result, truth)
def test_walking(self): fr = FileRecognizer( skip_hidden_files=True, skip_hidden_dirs=True, skip_exts=set([".skip_ext"]), skip_dirs=set(["skip_dir"]), ) truth = [ ("tree/binary", "binary"), ("tree/dir.skip_ext/text", "text"), ("tree/dir/subdir/text", "text"), ("tree/dir/text", "text"), ("tree/text", "text"), ("tree/text.dont_skip_ext", "text"), ] result = sorted(fr.walk("tree")) self.assertEqual(result, truth)
def test_dot_dot(): fr = FileRecognizer( skip_hidden_files=True, skip_hidden_dirs=True, skip_exts=set([b".skip_ext"]), skip_dirs=set([b"skip_dir"]), ) truth = [ (b"../binary", "binary"), (b"../dir.skip_ext/text", "text"), (b"../dir/subdir/text", "text"), (b"../dir/text", "text"), (b"../text", "text"), (b"../text.dont_skip_ext", "text"), ] result = sorted(fr.walk(b"..")) assert result == truth