MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / _init_hook_answers

Function _init_hook_answers

tests/commands/test_init_command.py:261–277  ·  view source on GitHub ↗

Stub the interactive init prompts and select hook installation.

(mocker: MockFixture)

Source from the content-addressed store, hash-verified

259
260
261def _init_hook_answers(mocker: MockFixture) -> None:
262 """Stub the interactive init prompts and select hook installation."""
263 mocker.patch(
264 "questionary.select",
265 side_effect=[
266 FakeQuestion("pyproject.toml"),
267 FakeQuestion("cz_conventional_commits"),
268 FakeQuestion("commitizen"),
269 FakeQuestion("semver"),
270 ],
271 )
272 mocker.patch("questionary.confirm", return_value=FakeQuestion(True))
273 mocker.patch("questionary.text", return_value=FakeQuestion("$version"))
274 mocker.patch(
275 "questionary.checkbox",
276 return_value=FakeQuestion(["commit-msg", "pre-push"]),
277 )
278
279
280class TestHookInstallerSelection:

Calls 1

FakeQuestionClass · 0.85

Tested by

no test coverage detected