diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2021-12-26 23:05:46 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2021-12-26 23:05:46 +0100 |
commit | bf232d2f3fa94f374d82464eb66bcc7d72adc3ed (patch) | |
tree | 48daafadce6d643a7fb342178c161ecec5be53fb /solo_tool_integrationtest.py | |
parent | 8622638f99277b43d40b61029dc3c56164d06cae (diff) |
Added temporary AB limit functionality to back end
Diffstat (limited to 'solo_tool_integrationtest.py')
-rw-r--r-- | solo_tool_integrationtest.py | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/solo_tool_integrationtest.py b/solo_tool_integrationtest.py index 9321e89..cd635d4 100644 --- a/solo_tool_integrationtest.py +++ b/solo_tool_integrationtest.py @@ -107,7 +107,7 @@ def test_addAndSetAbLimits(): uut.tick() assert mockPlayer.position == 0.5 - uut.setAbLimit(0) + uut.loadAbLimits(0) uut.tick() assert mockPlayer.position == 0.5 @@ -120,7 +120,7 @@ def test_addAndSetAbLimits(): uut.tick() assert mockPlayer.position == 0.2 - uut.setAbLimit(1) + uut.loadAbLimits(1) uut.tick() assert mockPlayer.position == 0.2 @@ -151,7 +151,7 @@ def test_multipleSongsAndAbLimits(): for i, l in enumerate(abLimits): uut.setSong(i) - uut.setAbLimit(0) + uut.loadAbLimits(0) mockPlayer.position = l[0] uut.tick() @@ -176,7 +176,7 @@ def test_storeAbLimitsWithoutSong(): assert mockPlayer.position == default mockPlayer.position = overflow - uut.setAbLimit(0) + uut.loadAbLimits(0) uut.tick() assert mockPlayer.position == default mockPlayer.position = overflow @@ -186,7 +186,7 @@ def test_storeAbLimitsWithoutSong(): assert mockPlayer.position == default mockPlayer.position = overflow - uut.setAbLimit(0) + uut.loadAbLimits(0) uut.tick() assert mockPlayer.position == default mockPlayer.position = overflow @@ -196,7 +196,7 @@ def test_storeAbLimitsWithoutSong(): assert mockPlayer.position == default mockPlayer.position = overflow - uut.setAbLimit(0) + uut.loadAbLimits(0) uut.tick() assert mockPlayer.position == default mockPlayer.position = overflow @@ -206,7 +206,7 @@ def test_storeAbLimitsWithoutSong(): assert mockPlayer.position == default mockPlayer.position = overflow - uut.setAbLimit(0) + uut.loadAbLimits(0) uut.tick() assert mockPlayer.position == abLimit[0] @@ -270,4 +270,24 @@ def test_getters(): mockPlayer.position = 0.8 assert uut.getPlaybackPosition() == 0.8 - +def test_setTemporaryLimits(): + song = "test.flac" + abLimits = [ + [0.2, 0.4], + [0.1, 0.4] + ] + overflow = 0.5 + mockPlayer = MockPlayer() + uut = SoloTool(mockPlayer) + + uut.setAbLimitEnable(True) + mockPlayer.position = overflow + uut.addSong(song) + uut.setSong(0) + uut.storeAbLimits(abLimits[0][0], abLimits[0][1]) + uut.loadAbLimits(0) + + uut.setAbLimits(abLimits[1][0], abLimits[1][1]) + uut.tick() + assert mockPlayer.position == abLimits[1][0] + |