diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-01-04 14:58:39 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-01-04 14:58:39 +0100 |
commit | 3eed7537f8cc0221a81951b24ef965f6b7f35d6e (patch) | |
tree | 11158ffd5c6d4d7403e6bde07308b0c3c4e65999 /solo_tool_integrationtest.py | |
parent | 3066dbcdd863342d3c9534886434d6e8aaa45367 (diff) |
Added song and AB limits change notification
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 |