feat: make alarm music file configurable via env var and CLI arg
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user