From b609b4ce55104c77a3f69366874a3e25e3061172 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Thu, 3 Feb 2022 20:20:30 +0100 Subject: Added AB toggle button to MIDI interface --- solo_tool_integrationtest.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'solo_tool_integrationtest.py') 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 -- cgit v1.2.3