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.py37
1 files changed, 36 insertions, 1 deletions
diff --git a/solo_tool_integrationtest.py b/solo_tool_integrationtest.py
index 6022454..117e539 100644
--- a/solo_tool_integrationtest.py
+++ b/solo_tool_integrationtest.py
@@ -311,7 +311,6 @@ def test_setTemporaryLimits(uut, mockPlayer):
assert mockPlayer.position == abLimits[1][0]
def test_jumpToA(uut, mockPlayer):
- song = "test.flac"
abLimits = (0.2, 0.4)
initialPosition = 0.8
@@ -324,3 +323,39 @@ def test_jumpToA(uut, mockPlayer):
uut.jumpToA()
assert mockPlayer.position == abLimits[0]
+def test_playingStateNotification(uut, mockPlayer):
+ song = "test.flac"
+ uut.addSong(song)
+ uut.setSong(0)
+
+ called = False
+ def callback():
+ nonlocal called
+ called = True
+
+ uut.registerPlayingStateCallback(callback)
+
+ assert mockPlayer.state == MockPlayer.STOPPED
+ assert not called
+
+ uut.play()
+ assert called
+ called = False
+ uut.play()
+ assert not called
+
+ uut.pause()
+ assert called
+ called = False
+ uut.pause()
+ assert not called
+
+ uut.play()
+ assert called
+ called = False
+
+ uut.stop()
+ assert called
+ called = False
+ uut.stop()
+ assert not called