Merge dev with main #27

Merged
8464960 merged 89 commits from dev into main 2026-01-28 10:54:23 +00:00
Showing only changes of commit 03519e2a16 - Show all commits

View File

@@ -41,6 +41,9 @@ class MicrophoneUtils(object):
"""
First mock an input that's not an integer, then a valid integer. There should be no errors.
"""
microphones = get_microphones(pyaudio_instance)
target_microphone = next(microphones)
mock_input = mocker.patch("__builtin__.raw_input", side_effect=["not an integer", "0"])
fake_out = StringIO()
mocker.patch.object(sys, "stdout", fake_out)
@@ -48,7 +51,7 @@ class MicrophoneUtils(object):
result = choose_mic_interactive(pyaudio_instance)
assert "index" in result
assert isinstance(result["index"], (int, long))
assert result["index"] == 0
assert result["index"] == target_microphone["index"]
assert mock_input.called
@@ -58,6 +61,9 @@ class MicrophoneUtils(object):
"""
Make sure that the interactive method does not allow negative integers as input.
"""
microphones = get_microphones(pyaudio_instance)
target_microphone = next(microphones)
mock_input = mocker.patch("__builtin__.raw_input", side_effect=["-1", "0"])
fake_out = StringIO()
mocker.patch.object(sys, "stdout", fake_out)
@@ -65,7 +71,7 @@ class MicrophoneUtils(object):
result = choose_mic_interactive(pyaudio_instance)
assert "index" in result
assert isinstance(result["index"], (int, long))
assert result["index"] == 0
assert result["index"] == target_microphone["index"]
assert mock_input.called