MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / test_install_overwrite

Function test_install_overwrite

tests/commands/install_uninstall_test.py:433–443  ·  view source on GitHub ↗
(tempdir_factory, store)

Source from the content-addressed store, hash-verified

431
432
433def test_install_overwrite(tempdir_factory, store):
434 path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
435 with cwd(path):
436 _write_legacy_hook(path)
437 assert not install(
438 C.CONFIG_FILE, store, hook_types=['pre-commit'], overwrite=True,
439 )
440
441 ret, output = _get_commit_output(tempdir_factory)
442 assert ret == 0
443 NORMAL_PRE_COMMIT_RUN.assert_matches(output)
444
445
446def test_uninstall_restores_legacy_hooks(tempdir_factory, store):

Callers

nothing calls this directly

Calls 5

make_consuming_repoFunction · 0.90
cwdFunction · 0.90
installFunction · 0.90
_write_legacy_hookFunction · 0.85
_get_commit_outputFunction · 0.85

Tested by

no test coverage detected