diff options
author | Eddy Pedroni <epedroni@pm.me> | 2025-02-24 21:45:50 +0100 |
---|---|---|
committer | Eddy Pedroni <epedroni@pm.me> | 2025-02-24 21:45:50 +0100 |
commit | 4b029ddcbccb75ef9aa129fa0d726fdee24af0bb (patch) | |
tree | 44377b7357df400a3eb969520f8992f481db1fb1 /solo-tool-project/test/solo_tool_integrationtest.py | |
parent | b65d54e662c7f7bde6d0f1d6bb195e6e7cb96af8 (diff) |
Improved key points notification
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 + |