diff --git a/tests/git_draft/drafter_test.py b/tests/git_draft/drafter_test.py index 3ab2e96..d272a7e 100644 --- a/tests/git_draft/drafter_test.py +++ b/tests/git_draft/drafter_test.py @@ -146,6 +146,17 @@ def test_generate_reuse_branch_sync(self) -> None: self._drafter.generate_draft("prompt2", bot, sync=True) assert len(self._commits()) == 4 # init, prompt, sync, prompt + def test_generate_noop(self) -> None: + self._write("unrelated", "a") + + class CustomBot(Bot): + def act(self, _goal: Goal, _toolbox: Toolbox) -> Action: + return Action() + + self._drafter.generate_draft("prompt", CustomBot()) + assert len(self._commits()) == 2 # init, prompt + assert not self._commit_files("HEAD") + def test_discard_outside_draft(self) -> None: with pytest.raises(RuntimeError): self._drafter.discard_draft()