aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-10 18:28:20 +0100
committerDanilo M. <danix@danix.xyz>2026-11-10 18:28:20 +0100
commitce70addd5b17da95a6e05c1fb1e94cb03944d99d (patch)
treee955b56adecab087bd91fc937283a4f62a38d400 /tests
parent5b85512ccd0d87cb61c30f73cea262c7a0545d37 (diff)
downloaddeck-it-ce70addd5b17da95a6e05c1fb1e94cb03944d99d.tar.gz
deck-it-ce70addd5b17da95a6e05c1fb1e94cb03944d99d.zip
feat(music): a volume slider with a mute toggle, icon buttons
The Vol-, Mute and Vol+ buttons give way to a mute toggle (its icon shows the state) and a 0-100 slider that sets the default sink with wpctl as it moves. Previous, play/pause and next are Nerd Font glyphs instead of the tablet's Unicode symbols. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_music.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_music.py b/tests/test_music.py
index ccf0539..aadfcc5 100644
--- a/tests/test_music.py
+++ b/tests/test_music.py
@@ -53,6 +53,15 @@ class Music(unittest.TestCase):
with self.assertRaises(music.ModuleError, msg=bad):
m.actions["seek"](bad)
+ def test_volume_sets_the_sink(self):
+ calls = []
+ m = music.make({"run": lambda *a, **k: "", "popen": calls.append})
+ m.actions["volume"]({"level": 45})
+ self.assertEqual(calls[0], ["wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "0.45"])
+ for bad in ({}, {"level": 101}, {"level": -1}, {"level": "5"}, {"level": True}):
+ with self.assertRaises(music.ModuleError, msg=bad):
+ m.actions["volume"](bad)
+
if __name__ == "__main__":
unittest.main()