Exemplo n.º 1
0
    def test_ignore_hidden(self):
        ms = get_match_patterns(ignore_hidden=True)
        assert ms == ['*', '!.*', '!.*/']

        # should not duplicate if present in (general) ignore
        ms = get_match_patterns(ignore=['.*'], ignore_hidden=True)
        assert ms == ['*', '!.*', '!.*/']

        ms = get_match_patterns(ignore=['.*/'], ignore_hidden=True)
        assert ms == ['*', '!.*/', '!.*']

        ms = get_match_patterns(ignore=['.*', '.*/'], ignore_hidden=True)
        assert ms == ['*', '!.*', '!.*/']
Exemplo n.º 2
0
    def test_ignore_extensions(self):
        ms = get_match_patterns(ignore_extensions=['.ext'])
        assert ms == ['*', '!*.ext']

        # automatically adds '.'
        ms = get_match_patterns(ignore_extensions=['ext'])
        assert ms == ['*', '!*.ext']

        # mixed also works
        ms = get_match_patterns(ignore_extensions=['ext1', '.ext2'])
        assert ms == ['*', '!*.ext1', '!*.ext2']

        # should not duplicate if present in (general) ignore
        ms = get_match_patterns(ignore=['*.ext'], ignore_extensions=['.ext'])
        assert ms == ['*', '!*.ext']

        ms = get_match_patterns(ignore=['*.ext'], ignore_extensions=['ext'])
        assert ms == ['*', '!*.ext']
Exemplo n.º 3
0
 def test_match_and_ignore(self):
     ms = get_match_patterns(match=['a*'], ignore=['*.ext'])
     assert ms == ['a*', '!*.ext']
Exemplo n.º 4
0
 def test_only_ignore(self):
     ms = get_match_patterns(ignore=['a*', 'b*'])
     assert ms == ['*', '!a*', '!b*']
Exemplo n.º 5
0
 def test_only_match(self):
     ms = get_match_patterns(match=['a*', 'b*'])
     assert ms == ['a*', 'b*']
Exemplo n.º 6
0
 def test_default_match_all(self):
     ms = get_match_patterns()
     assert ms == ['*']