mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Add pre-commit try-repo
`try-repo` is useful for: - Trying out a remote hook repository without needing to configure it. - Testing a hook repository while developing it.
This commit is contained in:
parent
e8641ee0a3
commit
2c88791a7f
15 changed files with 254 additions and 110 deletions
|
|
@ -92,12 +92,18 @@ def test_help_other_command(
|
|||
|
||||
|
||||
@pytest.mark.parametrize('command', CMDS)
|
||||
def test_install_command(command, mock_commands):
|
||||
def test_all_cmds(command, mock_commands):
|
||||
main.main((command,))
|
||||
assert getattr(mock_commands, command.replace('-', '_')).call_count == 1
|
||||
assert_only_one_mock_called(mock_commands)
|
||||
|
||||
|
||||
def test_try_repo():
|
||||
with mock.patch.object(main, 'try_repo') as patch:
|
||||
main.main(('try-repo', '.'))
|
||||
assert patch.call_count == 1
|
||||
|
||||
|
||||
def test_help_cmd_in_empty_directory(
|
||||
mock_commands,
|
||||
tempdir_factory,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue