aboutsummaryrefslogtreecommitdiffstats
path: root/solo_tool_integrationtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'solo_tool_integrationtest.py')
-rw-r--r--solo_tool_integrationtest.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/solo_tool_integrationtest.py b/solo_tool_integrationtest.py
index 117e539..98dd31b 100644
--- a/solo_tool_integrationtest.py
+++ b/solo_tool_integrationtest.py
@@ -291,6 +291,12 @@ def test_getters(uut, mockPlayer):
mockPlayer.position = 0.8
assert uut.getPlaybackPosition() == 0.8
+ mockPlayer.volume = 0.8
+ assert uut.getPlaybackVolume() == 0.8
+
+ mockPlayer.rate = 0.5
+ assert uut.getPlaybackRate() == 0.5
+
def test_setTemporaryLimits(uut, mockPlayer):
song = "test.flac"
abLimits = [
@@ -359,3 +365,45 @@ def test_playingStateNotification(uut, mockPlayer):
called = False
uut.stop()
assert not called
+
+def test_playbackVolumeNotification(uut, mockPlayer):
+ song = "test.flac"
+ uut.addSong(song)
+ uut.setSong(0)
+
+ called = False
+ def callback():
+ nonlocal called
+ called = True
+
+ uut.registerPlaybackVolumeCallback(callback)
+
+ assert not called
+
+ uut.setPlaybackVolume(0.0)
+ assert called
+ called = False
+
+ uut.setPlaybackVolume(0.0)
+ assert not called
+
+def test_playbackRateNotification(uut, mockPlayer):
+ song = "test.flac"
+ uut.addSong(song)
+ uut.setSong(0)
+
+ called = False
+ def callback():
+ nonlocal called
+ called = True
+
+ uut.registerPlaybackRateCallback(callback)
+
+ assert not called
+
+ uut.setPlaybackRate(0.5)
+ assert called
+ called = False
+
+ uut.setPlaybackRate(0.5)
+ assert not called