From bf232d2f3fa94f374d82464eb66bcc7d72adc3ed Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Sun, 26 Dec 2021 23:05:46 +0100 Subject: Added temporary AB limit functionality to back end --- abcontroller_unittest.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'abcontroller_unittest.py') diff --git a/abcontroller_unittest.py b/abcontroller_unittest.py index 736ac6b..6e6e779 100644 --- a/abcontroller_unittest.py +++ b/abcontroller_unittest.py @@ -182,8 +182,36 @@ def test_clearAbController(): assert uut.getLimits(s[0]) == None def test_setTemporaryLimits(): - pass + abLimits = [ + AB(0.2, 0.4), + AB(0.3, 0.5), + AB(0.0, 1.2) + ] + uut = ABController() + + for l in abLimits: + uut.setLimits(l.a, l.b) + checkLimits(uut, l.a, l.b) + +def test_setTemporaryLimitsWithCurrentSong(): + songLimits = AB(0.2, 0.4) + abLimits = [ + AB(0.2, 0.4), + AB(0.3, 0.5), + AB(0.0, 1.2) + ] + song = "/path/to/song" + uut = ABController() + uut.setCurrentSong(song) + uut.storeLimits(songLimits.a, songLimits.b) + uut.loadLimits(0) + + for l in abLimits: + uut.setLimits(l.a, l.b) + checkLimits(uut, l.a, l.b) + def test_defaultBehaviour(): uut = ABController() + checkDefaultLimits(uut) -- cgit v1.2.3