diff options
-rw-r--r-- | solo_tool.py | 3 | ||||
-rw-r--r-- | solo_tool_integrationtest.py | 22 |
2 files changed, 22 insertions, 3 deletions
diff --git a/solo_tool.py b/solo_tool.py index 565943c..79913a4 100644 --- a/solo_tool.py +++ b/solo_tool.py @@ -30,7 +30,6 @@ class SoloTool: def setSong(self, index): self._playlist.setCurrentSong(index) - # XXX untested def getSongs(self): return self._playlist.getSongs() @@ -40,7 +39,6 @@ class SoloTool: def setAbLimit(self, index): self._abController.setCurrentLimits(index) - # XXX untested def getAbLimits(self): currentSong = self._playlist.getCurrentSong() if currentSong is not None: @@ -74,7 +72,6 @@ class SoloTool: def setPlaybackPosition(self, position): self._player.setPlaybackPosition(position) - # XXX untested def getPlaybackPosition(self): return self._player.getPlaybackPosition() diff --git a/solo_tool_integrationtest.py b/solo_tool_integrationtest.py index 927bd2c..22e8143 100644 --- a/solo_tool_integrationtest.py +++ b/solo_tool_integrationtest.py @@ -241,3 +241,25 @@ def test_addInexistentFile(): uut.setSong(0) assert mockPlayer.currentSong == None + +def test_getters(): + 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]) + + assert uut.getSongs() == [song] + + limits = uut.getAbLimits() + assert len(limits) == 1 + assert limits[0][0] == abLimit[0] + assert limits[0][1] == abLimit[1] + + mockPlayer.position = 0.8 + assert uut.getPlaybackPosition() == 0.8 + + |