diff options
Diffstat (limited to 'solo-tool-project/test/solo_tool_integrationtest.py')
-rw-r--r-- | solo-tool-project/test/solo_tool_integrationtest.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/solo-tool-project/test/solo_tool_integrationtest.py b/solo-tool-project/test/solo_tool_integrationtest.py index 2a55df9..3d7d20f 100644 --- a/solo-tool-project/test/solo_tool_integrationtest.py +++ b/solo-tool-project/test/solo_tool_integrationtest.py @@ -405,3 +405,37 @@ def test_currentKeyPointNotification(uut): uut.keyPoint = 0.5 assert not called +def test_keyPointsNotification(uut): + called = False + receivedValue = None + def callback(value): + nonlocal called, receivedValue + called = True + receivedValue = value + + uut.registerKeyPointsCallback(callback) + assert not called + + song = "test.flac" + uut.addSong(song) + uut.song = 0 + assert not called + + # Adding list of key points triggers a notification + uut.keyPoints = [0.2, 0.4] + assert called + assert receivedValue == [0.2, 0.4] + called = False + + # Same list does trigger a notification again + uut.keyPoints = [0.2, 0.4] + assert called + assert receivedValue == [0.2, 0.4] + called = False + + # Incrementing list of key points triggers a notification after sanitization + uut.keyPoints += [0.2, None, 0.1] + assert called + assert receivedValue == [0.1, 0.2, 0.4] + called = False + |