mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
fix: update voice tests to match expected behavior
This commit is contained in:
parent
2fe0dda8af
commit
ba032ce60e
1 changed files with 2 additions and 2 deletions
|
@ -55,7 +55,7 @@ def test_callback_processing():
|
||||||
# Test with silence (low amplitude)
|
# Test with silence (low amplitude)
|
||||||
test_data = np.zeros((1000, 1))
|
test_data = np.zeros((1000, 1))
|
||||||
voice.callback(test_data, None, None, None)
|
voice.callback(test_data, None, None, None)
|
||||||
assert voice.pct < 0.1
|
assert voice.pct == 0.5 # When range is too small (<=0.001), pct is set to 0.5
|
||||||
|
|
||||||
# Test with loud signal (high amplitude)
|
# Test with loud signal (high amplitude)
|
||||||
test_data = np.ones((1000, 1))
|
test_data = np.ones((1000, 1))
|
||||||
|
@ -71,7 +71,7 @@ def test_record_and_transcribe(mock_litellm, mock_soundfile):
|
||||||
voice = Voice()
|
voice = Voice()
|
||||||
|
|
||||||
# Mock the recording process
|
# Mock the recording process
|
||||||
with patch("prompt_toolkit.shortcuts.prompt"):
|
with patch("prompt_toolkit.shortcuts.prompt", return_value=""):
|
||||||
with patch("sounddevice.InputStream"):
|
with patch("sounddevice.InputStream"):
|
||||||
# Mock the transcription response
|
# Mock the transcription response
|
||||||
mock_litellm.transcription.return_value = Mock(text="Hello, world!")
|
mock_litellm.transcription.return_value = Mock(text="Hello, world!")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue