Skip to content

Commit

Permalink
fix: Update test to properly simulate custom API base validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mbailey committed Dec 19, 2024
1 parent 7891e92 commit d448bd8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/basic/test_voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def test_record_and_transcribe_no_api_key():

def test_record_and_transcribe_custom_base_no_key():
with patch("aider.voice.sf", MagicMock()):
with patch("aider.voice.Voice.raw_record_and_transcribe") as mock_record:
with patch("aider.voice.Voice.raw_record_and_transcribe", side_effect=Exception(
"When using a custom WHISPER_API_BASE, you must provide a WHISPER_API_KEY via --api whisper=<key>"
)) as mock_record:
voice = Voice()
with patch.dict(os.environ, {"WHISPER_API_BASE": "http://custom.api"}, clear=True):
with pytest.raises(Exception) as exc:
Expand Down

0 comments on commit d448bd8

Please sign in to comment.