diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-02-03 20:20:30 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-02-03 20:20:30 +0100 |
commit | b609b4ce55104c77a3f69366874a3e25e3061172 (patch) | |
tree | db0095a810acc63d34e1719f59fca668fa693bf0 /solo_tool_integrationtest.py | |
parent | 6debe39546e62d5796f22db2388341ae9132042d (diff) |
Added AB toggle button to MIDI interface
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 |