diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-06-14 09:11:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-06-14 09:11:24 +0000 |
commit | 1312af87e5908ac252c0659a60216e96ec5b23bd (patch) | |
tree | 7621ad7267ffb9ecd8339983fd83150abc99082f /tests/commands/hook_impl_test.py | |
parent | Releasing debian version 2.3.0-1. (diff) | |
download | pre-commit-1312af87e5908ac252c0659a60216e96ec5b23bd.tar.xz pre-commit-1312af87e5908ac252c0659a60216e96ec5b23bd.zip |
Merging upstream version 2.5.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/commands/hook_impl_test.py')
-rw-r--r-- | tests/commands/hook_impl_test.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/commands/hook_impl_test.py b/tests/commands/hook_impl_test.py index ddf65b7..2fc0146 100644 --- a/tests/commands/hook_impl_test.py +++ b/tests/commands/hook_impl_test.py @@ -96,6 +96,7 @@ def test_run_legacy_recursive(tmpdir): ('pre-merge-commit', []), ('pre-push', ['branch_name', 'remote_name']), ('commit-msg', ['.git/COMMIT_EDITMSG']), + ('post-commit', []), ('post-checkout', ['old_head', 'new_head', '1']), # multiple choices for commit-editmsg ('prepare-commit-msg', ['.git/COMMIT_EDITMSG']), @@ -117,7 +118,7 @@ def test_check_args_length_error_too_many_plural(): ) -def test_check_args_length_error_too_many_singluar(): +def test_check_args_length_error_too_many_singular(): with pytest.raises(SystemExit) as excinfo: hook_impl._check_args_length('commit-msg', []) msg, = excinfo.value.args @@ -149,6 +150,13 @@ def test_run_ns_commit_msg(): assert ns.commit_msg_filename == '.git/COMMIT_MSG' +def test_run_ns_post_commit(): + ns = hook_impl._run_ns('post-commit', True, (), b'') + assert ns is not None + assert ns.hook_stage == 'post-commit' + assert ns.color is True + + def test_run_ns_post_checkout(): ns = hook_impl._run_ns('post-checkout', True, ('a', 'b', 'c'), b'') assert ns is not None |