summaryrefslogtreecommitdiffstats
path: root/tests/commands/hook_impl_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/commands/hook_impl_test.py')
-rw-r--r--tests/commands/hook_impl_test.py10
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