Merging upstream version 2.7.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
5aec43d541
commit
57d38a2ac5
24 changed files with 323 additions and 99 deletions
|
@ -159,7 +159,28 @@ def test_try_repo(mock_store_dir):
|
|||
def test_init_templatedir(mock_store_dir):
|
||||
with mock.patch.object(main, 'init_templatedir') as patch:
|
||||
main.main(('init-templatedir', 'tdir'))
|
||||
|
||||
assert patch.call_count == 1
|
||||
assert 'tdir' in patch.call_args[0]
|
||||
assert patch.call_args[1]['hook_types'] == ['pre-commit']
|
||||
assert patch.call_args[1]['skip_on_missing_config'] is True
|
||||
|
||||
|
||||
def test_init_templatedir_options(mock_store_dir):
|
||||
args = (
|
||||
'init-templatedir',
|
||||
'tdir',
|
||||
'--hook-type',
|
||||
'commit-msg',
|
||||
'--no-allow-missing-config',
|
||||
)
|
||||
with mock.patch.object(main, 'init_templatedir') as patch:
|
||||
main.main(args)
|
||||
|
||||
assert patch.call_count == 1
|
||||
assert 'tdir' in patch.call_args[0]
|
||||
assert patch.call_args[1]['hook_types'] == ['commit-msg']
|
||||
assert patch.call_args[1]['skip_on_missing_config'] is False
|
||||
|
||||
|
||||
def test_help_cmd_in_empty_directory(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue