mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 17:14:43 +04:00
fix for issue 246
This commit is contained in:
parent
2c70476c63
commit
72b61a81f9
3 changed files with 20 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ from pre_commit.util import cwd
|
|||
from pre_commit.util import resource_filename
|
||||
from testing.fixtures import git_dir
|
||||
from testing.fixtures import make_consuming_repo
|
||||
from testing.util import xfailif_no_symlink
|
||||
|
||||
|
||||
def test_is_not_our_pre_commit():
|
||||
|
|
@ -88,6 +89,15 @@ def test_install_hooks_directory_not_present(tmpdir_factory):
|
|||
assert os.path.exists(runner.pre_commit_path)
|
||||
|
||||
|
||||
@xfailif_no_symlink
|
||||
def test_install_hooks_dead_symlink(tmpdir_factory):
|
||||
path = git_dir(tmpdir_factory)
|
||||
os.symlink('/fake/baz', os.path.join(path, '.git', 'hooks', 'pre-commit'))
|
||||
runner = Runner(path)
|
||||
install(runner)
|
||||
assert os.path.exists(runner.pre_commit_path)
|
||||
|
||||
|
||||
def test_uninstall_does_not_blow_up_when_not_there(tmpdir_factory):
|
||||
path = git_dir(tmpdir_factory)
|
||||
runner = Runner(path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue