Actually use the exclude pattern. Closes #47.

This commit is contained in:
Anthony Sottile 2014-03-31 23:35:25 -07:00
parent ac67af21ec
commit 535be5b33a
3 changed files with 17 additions and 8 deletions

View file

@ -29,7 +29,7 @@ def get_files_matching_func():
def test_get_files_matching_base(get_files_matching_func):
ret = get_files_matching_func('')
ret = get_files_matching_func('', '^$')
assert ret == set([
'pre_commit/run.py',
'pre_commit/git.py',
@ -38,7 +38,7 @@ def test_get_files_matching_base(get_files_matching_func):
def test_get_files_matching_total_match(get_files_matching_func):
ret = get_files_matching_func('^.*\.py$')
ret = get_files_matching_func('^.*\.py$', '^$')
assert ret == set([
'pre_commit/run.py',
'pre_commit/git.py',
@ -46,10 +46,15 @@ def test_get_files_matching_total_match(get_files_matching_func):
def test_does_search_instead_of_match(get_files_matching_func):
ret = get_files_matching_func('\.yaml$')
ret = get_files_matching_func('\.yaml$', '^$')
assert ret == set(['hooks.yaml'])
def test_does_not_include_deleted_fileS(get_files_matching_func):
ret = get_files_matching_func('exist.py')
ret = get_files_matching_func('exist.py', '^$')
assert ret == set()
def test_exclude_removes_files(get_files_matching_func):
ret = get_files_matching_func('', '\.py$')
assert ret == set(['hooks.yaml'])