MCPcopy
hub / github.com/pre-commit/pre-commit / test_commit_am

Function test_commit_am

tests/commands/install_uninstall_test.py:203–217  ·  view source on GitHub ↗

Regression test for #322.

(tempdir_factory, store)

Source from the content-addressed store, hash-verified

201
202
203def test_commit_am(tempdir_factory, store):
204 """Regression test for #322."""
205 path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
206 with cwd(path):
207 # Make an unstaged change
208 open('unstaged', 'w').close()
209 cmd_output('git', 'add', '.')
210 git_commit(cwd=path)
211 with open('unstaged', 'w') as foo_file:
212 foo_file.write('Oh hai')
213
214 assert install(C.CONFIG_FILE, store, hook_types=['pre-commit']) == 0
215
216 ret, output = _get_commit_output(tempdir_factory)
217 assert ret == 0
218
219
220def test_unicode_merge_commit_message(tempdir_factory, store):

Callers

nothing calls this directly

Calls 6

make_consuming_repoFunction · 0.90
cwdFunction · 0.90
cmd_outputFunction · 0.90
git_commitFunction · 0.90
installFunction · 0.90
_get_commit_outputFunction · 0.85

Tested by

no test coverage detected