From 71f6a49110b6696ca6ac7956baa4edaa1aaa9527 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Sat, 1 Jan 2022 10:18:37 +0100 Subject: Added partial Launchpad support, refactored existing files --- solo_tool_integrationtest.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'solo_tool_integrationtest.py') 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] + -- cgit v1.2.3