diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-01-01 19:09:01 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-01-01 19:09:01 +0100 |
commit | f7480bb96323b8466ad8e097475db2a7135c88e0 (patch) | |
tree | ce588932ed3afd93ecdb21941d357c7fe56c40df /abcontroller_unittest.py | |
parent | d28a1b91afa86b6e39ac4df24d8bada7e795b20b (diff) |
Added next/previous AB limit functionality
Diffstat (limited to 'abcontroller_unittest.py')
-rw-r--r-- | abcontroller_unittest.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/abcontroller_unittest.py b/abcontroller_unittest.py index 4f79fd9..f9e947d 100644 --- a/abcontroller_unittest.py +++ b/abcontroller_unittest.py @@ -218,3 +218,51 @@ def test_defaultBehaviour(): uut = ABController() checkDefaultLimits(uut) +def test_nextStoredLimit(): + song = "/path/to/song" + abLimits = [ + AB(0.2, 0.4), + AB(0.3, 0.5) + ] + + uut = ABController() + uut.setCurrentSong(song) + for l in abLimits: + uut.storeLimits(l.a, l.b) + + checkDefaultLimits(uut) + + uut.nextStoredAbLimits() + checkLimits(uut, abLimits[0].a, abLimits[0].b) + + uut.nextStoredAbLimits() + checkLimits(uut, abLimits[1].a, abLimits[1].b) + + uut.nextStoredAbLimits() + checkLimits(uut, abLimits[1].a, abLimits[1].b) + +def test_previousStoredLimit(): + song = "/path/to/song" + abLimits = [ + AB(0.2, 0.4), + AB(0.3, 0.5) + ] + + uut = ABController() + uut.setCurrentSong(song) + for l in abLimits: + uut.storeLimits(l.a, l.b) + + checkDefaultLimits(uut) + + uut.previousStoredAbLimits() + checkLimits(uut, abLimits[0].a, abLimits[0].b) + + uut.previousStoredAbLimits() + checkLimits(uut, abLimits[0].a, abLimits[0].b) + + uut.loadLimits(1) + checkLimits(uut, abLimits[1].a, abLimits[1].b) + + uut.previousStoredAbLimits() + checkLimits(uut, abLimits[0].a, abLimits[0].b) |