aboutsummaryrefslogtreecommitdiffstats
path: root/solo-tool-project/test/solo_tool_integrationtest.py
diff options
context:
space:
mode:
authorEddy Pedroni <epedroni@pm.me>2025-07-17 23:24:15 +0200
committerEddy Pedroni <epedroni@pm.me>2025-07-17 23:24:15 +0200
commit748f056faf16b08ac41de991b1aeb664f2b86d8e (patch)
tree451b807a1abd54f99057070423eda6f49f8511ab /solo-tool-project/test/solo_tool_integrationtest.py
parent7fb8e255e2e1cc912b029a5715db5b92258293b6 (diff)
Per-song volumeHEADv2.1master
Diffstat (limited to 'solo-tool-project/test/solo_tool_integrationtest.py')
-rw-r--r--solo-tool-project/test/solo_tool_integrationtest.py37
1 files changed, 36 insertions, 1 deletions
diff --git a/solo-tool-project/test/solo_tool_integrationtest.py b/solo-tool-project/test/solo_tool_integrationtest.py
index b92cd85..e5745bb 100644
--- a/solo-tool-project/test/solo_tool_integrationtest.py
+++ b/solo-tool-project/test/solo_tool_integrationtest.py
@@ -1,6 +1,6 @@
from fixtures import soloTool as uut, mockPlayer, testSongs
-def test_playerControls(uut, mockPlayer):
+def test_playerControls(uut, mockPlayer, testSongs):
assert not mockPlayer.playing
assert not uut.playing
uut.play()
@@ -130,6 +130,41 @@ def test_playbackVolumeNotification(uut, mockPlayer, testSongs):
uut.volume = 0.3
assert not called
+ # Volume can also change when the song changes
+ uut.addSong(testSongs[1])
+ uut.song = 1
+ assert called
+ assert receivedValue == 1.0
+ called = False
+
+ uut.volume = 0.3
+ assert called
+ assert receivedValue == 0.3
+ called = False
+
+ uut.song = 0
+ assert not called
+
+def test_playbackVolumeNotificationBeforeFirstSong(uut, mockPlayer, testSongs):
+ called = False
+ receivedValue = None
+ def callback(value):
+ nonlocal called, receivedValue
+ called = True
+ receivedValue = value
+
+ uut.registerVolumeCallback(callback)
+ assert not called
+
+ uut.volume = 0.3
+ assert called
+ assert receivedValue == 0.3
+ called = False
+
+ uut.addSong(testSongs[0])
+ assert called
+ assert receivedValue == 1.0
+
def test_playbackRateNotification(uut, mockPlayer, testSongs):
uut.addSong(testSongs[0])