Skip to content

Commit f3ffccf

Browse files
committed
fix(test_commit_command): update test assertions for multiline input feature
- Replace assert_called_once() with assert called for prompt mocks - Tests now work with new multiline behavior that calls questionary.prompt multiple times
1 parent 2cc9ad8 commit f3ffccf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/commands/test_commit_command.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def test_commit_backup_on_failure(config, mocker: MockFixture):
7676
temp_file = commit_cmd.temp_file
7777
commit_cmd()
7878

79-
prompt_mock.assert_called_once()
79+
# The multiline feature calls prompt multiple times, so don't assert call count
80+
assert prompt_mock.called
8081
error_mock.assert_called_once()
8182
assert os.path.isfile(temp_file)
8283

@@ -130,7 +131,8 @@ def test_commit_retry_after_failure_no_backup(config, mocker: MockFixture):
130131
commands.Commit(config, {})()
131132

132133
commit_mock.assert_called_with("feat: user created\n\ncloses #21", args="")
133-
prompt_mock.assert_called_once()
134+
# The multiline feature calls prompt multiple times, so don't assert call count
135+
assert prompt_mock.called
134136
success_mock.assert_called_once()
135137

136138

@@ -175,7 +177,8 @@ def test_commit_retry_after_failure_with_no_retry_works(config, mocker: MockFixt
175177
commit_cmd()
176178

177179
commit_mock.assert_called_with("feat: user created\n\ncloses #21", args="")
178-
prompt_mock.assert_called_once()
180+
# The multiline feature calls prompt multiple times, so don't assert call count
181+
assert prompt_mock.called
179182
success_mock.assert_called_once()
180183
assert not os.path.isfile(temp_file)
181184

0 commit comments

Comments
 (0)