From 3eed7537f8cc0221a81951b24ef965f6b7f35d6e Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Tue, 4 Jan 2022 14:58:39 +0100 Subject: Added song and AB limits change notification --- solo_tool_integrationtest.py | 91 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'solo_tool_integrationtest.py') 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 -- cgit v1.2.3