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.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/solo_tool_integrationtest.py b/solo_tool_integrationtest.py
index a927bfb..af0a921 100644
--- a/solo_tool_integrationtest.py
+++ b/solo_tool_integrationtest.py
@@ -8,12 +8,16 @@ def test_playerControls():
uut = SoloTool(mockPlayer)
assert mockPlayer.state == MockPlayer.STOPPED
+ assert uut.isPlaying() == False
uut.play()
assert mockPlayer.state == MockPlayer.PLAYING
+ assert uut.isPlaying() == True
uut.pause()
assert mockPlayer.state == MockPlayer.PAUSED
+ assert uut.isPlaying() == False
uut.stop()
assert mockPlayer.state == MockPlayer.STOPPED
+ assert uut.isPlaying() == False
assert mockPlayer.rate == 1.0
uut.setPlaybackRate(0.5)
@@ -221,7 +225,7 @@ def test_getters():
assert uut.getSongs() == [song]
- limits = uut.getAbLimits()
+ limits = uut.getStoredAbLimits()
assert len(limits) == 1
assert limits[0][0] == abLimit[0]
assert limits[0][1] == abLimit[1]
@@ -250,3 +254,19 @@ def test_setTemporaryLimits():
uut.tick()
assert mockPlayer.position == abLimits[1][0]
+def test_jumpToA():
+ song = "test.flac"
+ abLimits = (0.2, 0.4)
+ initialPosition = 0.8
+ mockPlayer = MockPlayer()
+ uut = SoloTool(mockPlayer)
+
+ mockPlayer.position = initialPosition
+
+ uut.jumpToA()
+ assert mockPlayer.position == 0.0 # default AB controller A limit
+
+ uut.setAbLimits(abLimits[0], abLimits[1])
+ uut.jumpToA()
+ assert mockPlayer.position == abLimits[0]
+