blob: 4b11e71567ef87cd8dc8fc6ca40dd150174b115a [file] [log] [blame]
Anthony Sottileda882282016-01-14 19:03:11 -08001import os
2
Benjamin Chess896c0cf2016-01-14 15:25:46 -08003import pytest
4
5from pre_commit_hooks.check_symlinks import check_symlinks
6from testing.util import get_resource_path
7
8
Anthony Sottileda882282016-01-14 19:03:11 -08009@pytest.mark.xfail(os.name == 'nt', reason='No symlink support on windows')
Benjamin Chess896c0cf2016-01-14 15:25:46 -080010@pytest.mark.parametrize(('filename', 'expected_retval'), (
11 ('broken_symlink', 1),
12 ('working_symlink', 0),
13))
14def test_check_symlinks(filename, expected_retval):
15 ret = check_symlinks([get_resource_path(filename)])
16 assert ret == expected_retval