mirror of
https://github.com/apirrone/Open_Duck_Mini_Runtime.git
synced 2025-09-02 19:23:54 +00:00
Update tests/sounds_test.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
09183bbba3
commit
0a8a4247e6
1 changed files with 2 additions and 2 deletions
|
@ -98,8 +98,8 @@ def test_no_overlap_play(monkeypatch):
|
|||
mock_sound = mock.MagicMock()
|
||||
mock_mixer.Sound.return_value = mock_sound
|
||||
# Simulate busy state for first call, then not busy
|
||||
busy_states = [True, False]
|
||||
mock_mixer.get_busy.side_effect = lambda: busy_states.pop(0) if busy_states else False
|
||||
busy_states_iter = iter([True, False])
|
||||
mock_mixer.get_busy.side_effect = lambda: next(busy_states_iter, False)
|
||||
# Patch os.listdir to return a fake .wav file
|
||||
with mock.patch("os.listdir", return_value=["happy1.wav"]):
|
||||
sound_player = Sounds(volume=0.5, sound_directory=assets_dir, mixer=mock_mixer)
|
||||
|
|
Loading…
Reference in a new issue