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.py48
1 files changed, 39 insertions, 9 deletions
diff --git a/solo_tool_integrationtest.py b/solo_tool_integrationtest.py
index 561778b..b3a0978 100644
--- a/solo_tool_integrationtest.py
+++ b/solo_tool_integrationtest.py
@@ -43,15 +43,6 @@ class MockPlayer():
def setCurrentSong(self, path):
self.currentSong = path
-def test_addAndSetSong():
- song = "/path/to/song"
- mockPlayer = MockPlayer()
-
- uut = SoloTool(mockPlayer)
-
- uut.addSong(song)
- uut.setSong(0)
-
def test_playerControls():
mockPlayer = MockPlayer()
uut = SoloTool(mockPlayer)
@@ -75,3 +66,42 @@ def test_playerControls():
assert mockPlayer.volume == 1.0
uut.setPlaybackVolume(0.5)
assert mockPlayer.volume == 0.5
+
+def test_addAndSetSong():
+ song = "test.flac"
+ mockPlayer = MockPlayer()
+ uut = SoloTool(mockPlayer)
+
+ uut.addSong(song)
+ assert mockPlayer.currentSong == ""
+
+ uut.setSong(0)
+ assert mockPlayer.currentSong == song
+
+def test_addAndSetAbLimit():
+ song = "test.flac"
+ abLimit = [0.2, 0.4]
+ mockPlayer = MockPlayer()
+ uut = SoloTool(mockPlayer)
+
+ uut.addSong(song)
+ uut.setSong(0)
+
+ uut.addAbLimit(abLimit[0], abLimit[1])
+
+ mockPlayer.position = 0.0
+ uut.tick()
+ assert mockPlayer.position == 0.0
+
+ mockPlayer.position = 0.5
+ uut.tick()
+ assert mockPlayer.position == 0.5
+
+ uut.setAbLimit(0)
+
+ uut.tick()
+ assert mockPlayer.position == 0.2
+
+ uut.tick()
+ assert mockPlayer.position == 0.2
+