Skip to content

Commit 3f83752

Browse files
authored
test: add noop test (#38)
1 parent 55c5f91 commit 3f83752

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/git_draft/drafter_test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,17 @@ def test_generate_reuse_branch_sync(self) -> None:
146146
self._drafter.generate_draft("prompt2", bot, sync=True)
147147
assert len(self._commits()) == 4 # init, prompt, sync, prompt
148148

149+
def test_generate_noop(self) -> None:
150+
self._write("unrelated", "a")
151+
152+
class CustomBot(Bot):
153+
def act(self, _goal: Goal, _toolbox: Toolbox) -> Action:
154+
return Action()
155+
156+
self._drafter.generate_draft("prompt", CustomBot())
157+
assert len(self._commits()) == 2 # init, prompt
158+
assert not self._commit_files("HEAD")
159+
149160
def test_discard_outside_draft(self) -> None:
150161
with pytest.raises(RuntimeError):
151162
self._drafter.discard_draft()

0 commit comments

Comments
 (0)