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

Function test_commit_msg_hook

tests/commands/run_test.py:851–864  ·  view source on GitHub ↗
(cap_out, store, commit_msg_repo)

Source from the content-addressed store, hash-verified

849
850
851def test_commit_msg_hook(cap_out, store, commit_msg_repo):
852 filename = '.git/COMMIT_EDITMSG'
853 with open(filename, 'w') as f:
854 f.write('This is the commit message')
855
856 _test_run(
857 cap_out,
858 store,
859 commit_msg_repo,
860 {'hook_stage': 'commit-msg', 'commit_msg_filename': filename},
861 expected_outputs=[b'Must have "Signed off by:"', b'Failed'],
862 expected_ret=1,
863 stage=False,
864 )
865
866
867def test_post_checkout_hook(cap_out, store, tempdir_factory):

Callers

nothing calls this directly

Calls 1

_test_runFunction · 0.85

Tested by

no test coverage detected