feat: make alarm music file configurable via env var and CLI arg

This commit is contained in:
2026-06-18 17:01:26 +02:00
parent 434c49b609
commit dfc9f0cd94
3 changed files with 39 additions and 6 deletions
+12
View File
@@ -124,3 +124,15 @@ def test_blinking_updates_time_correctly(mock_time, mock_gpio, mock_pygame):
assert clock.state == wecker.STATE_WAIT_FOR_INPUT
assert clock.last_interaction_time == 200.0
def test_setup_uses_env_music_file(mock_gpio, mock_pygame, monkeypatch):
monkeypatch.setenv("MUSIC_FILE", "/custom/track.mp3")
wecker.setup()
mock_pygame.mixer.music.load.assert_called_with("/custom/track.mp3")
def test_setup_music_file_argument_overrides_env(mock_gpio, mock_pygame, monkeypatch):
monkeypatch.setenv("MUSIC_FILE", "/env/track.mp3")
wecker.setup(music_file="/arg/track.mp3")
mock_pygame.mixer.music.load.assert_called_with("/arg/track.mp3")