aboutsummaryrefslogtreecommitdiffstats
path: root/abcontroller_unittest.py
diff options
context:
space:
mode:
Diffstat (limited to 'abcontroller_unittest.py')
-rw-r--r--abcontroller_unittest.py48
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)