Esempio n. 1
0
    def test_ignore_file_keep_dir(self):
        f = makeDirFilter([
            'a/foo.txt'
        ])

        assert f('a/')
        assert f('./a')
        assert f('b/a/')
Esempio n. 2
0
    def test_dir_at_any_depth(self):
        f = makeDirFilter([
            'a/'
        ])

        assert f('a/')
        assert f('./a')
        assert f('b/a/')
Esempio n. 3
0
    def test_double_asterisk_in_a_path_starting_with_dot(self):
        f = makeDirFilter([
            './a/**/c/'
        ])

        assert f('./a/b/c')
        assert f('./a/b1/b2/c')
        assert f('./a/b/d') is False
        assert f('a/b/c')
Esempio n. 4
0
    def test_working_directory_dot_slash(self):
        f = makeDirFilter([
            '././'
        ])

        assert f('.')
        assert f('./')
        assert f('foo.txt')
        assert f('./foo.txt')
        assert f('a/b/')
Esempio n. 5
0
    def test_excluded_dir(self):
        f = makeDirFilter([
            'a/',
            '!a/b/',
            '!a/c/foo.txt',
            '!a/d/',
            '+a/d/baz.txt'
        ])

        assert f('a/')
        assert f('a/b/') is False
        assert f('a/c/')
        assert f('a/d/')
Esempio n. 6
0
def get_dir_filter(groups):
    return makeDirFilter(sorted(set(chain(
        *(d['rules'] for d in groups.values())
    ))))
Esempio n. 7
0
def get_dir_filter(groups):
    return makeDirFilter(
        sorted(set(chain(*(d['rules'] for d in groups.values())))))
Esempio n. 8
0
    def test_empty_rules(self):
        f = makeDirFilter([])

        assert f('') is False
        assert f('a/') is False