| 369 | ], |
| 370 | ) |
| 371 | def 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") |