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

Function test_commit_with_spaces_in_path

tests/test_git.py:371–382  ·  view source on GitHub ↗
(
    mocker: MockFixture, file_path: str, expected_cmd: list[str], util: UtilFixture
)

Source from the content-addressed store, hash-verified

369 ],
370)
371def test_commit_with_spaces_in_path(
372 mocker: MockFixture, file_path: str, expected_cmd: list[str], util: UtilFixture
373):
374 mock_run = util.mock_cmd()
375 mock_unlink = mocker.patch("os.unlink")
376 mock_temp_file = mocker.patch("commitizen.git.NamedTemporaryFile")
377 mock_temp_file.return_value.name = file_path
378
379 git.commit("feat: new feature", ["--signoff"])
380
381 mock_run.assert_called_once_with(expected_cmd, env=None)
382 mock_unlink.assert_called_once_with(file_path)
383
384
385@pytest.mark.usefixtures("tmp_commitizen_project")

Callers

nothing calls this directly

Calls 1

mock_cmdMethod · 0.80

Tested by

no test coverage detected