aboutsummaryrefslogtreecommitdiffstats
path: root/solo_tool_integrationtest.py
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2022-01-03 18:49:09 +0100
committerEddy Pedroni <eddy@0xf7.com>2022-01-03 18:49:09 +0100
commit91cbf23d3acc3e44b333cac95d45575bc7bacb1c (patch)
treed6f336363ce050e3dfb54d2f1d01dbec136104c1 /solo_tool_integrationtest.py
parentd9c8684447654f1b7b4b3b0f25a7a56d42a8f535 (diff)
Added basic event notification capabilities, first event
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