aboutsummaryrefslogtreecommitdiffstats
path: root/solo_tool_integrationtest.py
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2022-01-01 10:18:37 +0100
committerEddy Pedroni <eddy@0xf7.com>2022-01-01 10:18:37 +0100
commit71f6a49110b6696ca6ac7956baa4edaa1aaa9527 (patch)
treee16178d2db8c6a8b7459801aab34d46255d4e8f6 /solo_tool_integrationtest.py
parent9090422b2ba5eab9e4131f9b9281ed83128d977c (diff)
Added partial Launchpad support, refactored existing files
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]
+