mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-04 19:26:52 +00:00
new hook tests for broken symlinks
This commit is contained in:
parent
5edf945ca5
commit
896c0cfdc0
5 changed files with 41 additions and 0 deletions
13
tests/check_symlinks_test.py
Normal file
13
tests/check_symlinks_test.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import pytest
|
||||
|
||||
from pre_commit_hooks.check_symlinks import check_symlinks
|
||||
from testing.util import get_resource_path
|
||||
|
||||
|
||||
@pytest.mark.parametrize(('filename', 'expected_retval'), (
|
||||
('broken_symlink', 1),
|
||||
('working_symlink', 0),
|
||||
))
|
||||
def test_check_symlinks(filename, expected_retval):
|
||||
ret = check_symlinks([get_resource_path(filename)])
|
||||
assert ret == expected_retval
|
||||
Loading…
Add table
Add a link
Reference in a new issue