diff options
Diffstat (limited to 'solo_tool_integrationtest.py')
-rw-r--r-- | solo_tool_integrationtest.py | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/solo_tool_integrationtest.py b/solo_tool_integrationtest.py index 98dd31b..386cb26 100644 --- a/solo_tool_integrationtest.py +++ b/solo_tool_integrationtest.py @@ -407,3 +407,94 @@ def test_playbackRateNotification(uut, mockPlayer): uut.setPlaybackRate(0.5) assert not called + +def test_currentSongNotification(uut): + called = False + def callback(): + nonlocal called + called = True + + uut.registerCurrentSongCallback(callback) + assert not called + + songs = [ + "test.flac", + "test.mp3" + ] + uut.addSong(songs[0]) + assert not called + + uut.setSong(0) + assert called + called = False + + uut.addSong(songs[1]) + assert not called + + uut.setSong(0) + assert not called + + uut.setSong(1) + assert called + called = False + + uut.previousSong() + assert called + called = False + + uut.previousSong() + assert not called + + uut.nextSong() + assert called + called = False + + uut.nextSong() + assert not called + +def test_currentAbNotification(uut): + called = False + def callback(): + nonlocal called + called = True + + uut.registerCurrentAbLimitsCallback(callback) + assert not called + + song = "test.flac" + uut.addSong(song) + uut.setSong(0) + + abLimits = [ + (0.2, 0.3), + (0.4, 0.5) + ] + uut.storeAbLimits(abLimits[0][0], abLimits[0][1]) + assert not called + uut.storeAbLimits(abLimits[1][0], abLimits[1][1]) + assert not called + + uut.loadAbLimits(0) + assert called + called = False + + uut.loadAbLimits(0) + assert not called + + uut.loadAbLimits(1) + assert called + called = False + + uut.previousStoredAbLimits() + assert called + called = False + + uut.previousStoredAbLimits() + assert not called + + uut.nextStoredAbLimits() + assert called + called = False + + uut.nextStoredAbLimits() + assert not called |