(monkeypatch: pytest.MonkeyPatch, util: UtilFixture)
| 324 | |
| 325 | |
| 326 | def test_get_core_editor(monkeypatch: pytest.MonkeyPatch, util: UtilFixture): |
| 327 | monkeypatch.setenv("GIT_EDITOR", "nano") |
| 328 | assert git.get_core_editor() == "nano" |
| 329 | |
| 330 | monkeypatch.delenv("GIT_EDITOR") |
| 331 | |
| 332 | util.mock_cmd(out="vim") |
| 333 | assert git.get_core_editor() == "vim" |
| 334 | |
| 335 | util.mock_cmd() |
| 336 | assert git.get_core_editor() is None |
| 337 | |
| 338 | |
| 339 | @pytest.mark.usefixtures("tmp_commitizen_project") |