diff options
Diffstat (limited to 'solo_tool_integrationtest.py')
-rw-r--r-- | solo_tool_integrationtest.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/solo_tool_integrationtest.py b/solo_tool_integrationtest.py index ee99303..5731eac 100644 --- a/solo_tool_integrationtest.py +++ b/solo_tool_integrationtest.py @@ -137,6 +137,15 @@ def test_addAndSetAbLimits(uut, mockPlayer): uut.tick() assert mockPlayer.position == 0.1 +def test_abLimitEnabledGetter(uut): + assert not uut.isAbLimitEnabled() + + uut.setAbLimitEnable(True) + assert uut.isAbLimitEnabled() + + uut.setAbLimitEnable(False) + assert not uut.isAbLimitEnabled() + def test_multipleSongsAndAbLimits(uut, mockPlayer): songs = [ "test.flac", @@ -554,3 +563,32 @@ def test_currentAbNotification(uut): uut.nextStoredAbLimits() assert not called + +def test_abLimitEnabledNotification(uut): + called = False + receivedValue = None + def callback(value): + nonlocal called, receivedValue + called = True + receivedValue = value + + uut.registerAbLimitEnabledCallback(callback) + assert not called + + uut.setAbLimitEnable(False) + assert not called + assert receivedValue is None + + uut.setAbLimitEnable(True) + assert called + assert receivedValue == True + called = False + receivedValue = None + + uut.setAbLimitEnable(True) + assert not called + assert receivedValue is None + + uut.setAbLimitEnable(False) + assert called + assert receivedValue == False |