diff options
Diffstat (limited to 'abcontroller_unittest.py')
-rw-r--r-- | abcontroller_unittest.py | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/abcontroller_unittest.py b/abcontroller_unittest.py index 8eb401a..0e004ff 100644 --- a/abcontroller_unittest.py +++ b/abcontroller_unittest.py @@ -33,8 +33,8 @@ def test_oneSetOfLimits(): uut = ABController() uut.setCurrentSong(song) - uut.addLimits(abLimits.a, abLimits.b) - uut.setCurrentLimits(0) + uut.storeLimits(abLimits.a, abLimits.b) + uut.loadLimits(0) checkLimits(uut, abLimits.a, abLimits.b) assert uut.getLimits(song) == [abLimits] @@ -50,10 +50,10 @@ def test_multipleSetsOfLimits(): uut = ABController() uut.setCurrentSong(song) for l in abLimits: - uut.addLimits(l.a, l.b) + uut.storeLimits(l.a, l.b) for i, l in enumerate(abLimits): - uut.setCurrentLimits(i) + uut.loadLimits(i) checkLimits(uut, l.a, l.b) assert uut.getLimits(song) == abLimits @@ -69,11 +69,11 @@ def test_multipleSongs(): ] uut = ABController() for i, s in enumerate(songs): - uut.addLimits(abLimits[i].a, abLimits[i].b, s) + uut.storeLimits(abLimits[i].a, abLimits[i].b, s) for i, s in enumerate(songs): uut.setCurrentSong(s) - uut.setCurrentLimits(0) + uut.loadLimits(0) checkLimits(uut, abLimits[i].a, abLimits[i].b) assert uut.getLimits(s) == [abLimits[i]] @@ -83,8 +83,8 @@ def test_disableAbRepeat(): uut = ABController() uut.setCurrentSong(song) - uut.addLimits(abLimits.a, abLimits.b) - uut.setCurrentLimits(0) + uut.storeLimits(abLimits.a, abLimits.b) + uut.loadLimits(0) uut.setEnable(False) checkLimits(uut, abLimits.a, abLimits.b, fail=True) @@ -92,28 +92,28 @@ def test_disableAbRepeat(): uut.setEnable(True) checkLimits(uut, abLimits.a, abLimits.b) -def test_addLimitsToSpecificSong(): +def test_storeLimitsToSpecificSong(): song = "/path/to/song" uut = ABController() - uut.addLimits(abLimits.a, abLimits.b, song) + uut.storeLimits(abLimits.a, abLimits.b, song) uut.setCurrentSong(song) - uut.setCurrentLimits(0) + uut.loadLimits(0) checkLimits(uut, abLimits.a, abLimits.b) -def test_addLimitsWithoutCurrentSong(): +def test_storeLimitsWithoutCurrentSong(): uut = ABController() - uut.addLimits(abLimits.a, abLimits.b) - uut.setCurrentLimits(0) + uut.storeLimits(abLimits.a, abLimits.b) + uut.loadLimits(0) checkLimits(uut, abLimits.a, abLimits.b, fail=True) -def test_addLimitsToSongWithoutCurrentSong(): +def test_storeLimitsToSongWithoutCurrentSong(): song = "/path/to/song" uut = ABController() - uut.addLimits(abLimits.a, abLimits.b, song) - uut.setCurrentLimits(0) + uut.storeLimits(abLimits.a, abLimits.b, song) + uut.loadLimits(0) checkLimits(uut, abLimits.a, abLimits.b, fail=True) @@ -121,19 +121,19 @@ def test_addLimitsToSongWithoutCurrentSong(): checkLimits(uut, abLimits.a, abLimits.b, fail=True) - uut.setCurrentLimits(0) + uut.loadLimits(0) checkLimits(uut, abLimits.a, abLimits.b) -def test_addLimitsToCurrentSongButDoNotSetCurrentLimits(): +def test_storeLimitsToCurrentSongButDoNotSetCurrentLimits(): song = "/path/to/song" uut = ABController() uut.setCurrentSong(song) - uut.addLimits(abLimits.a, abLimits.b) + uut.storeLimits(abLimits.a, abLimits.b) checkLimits(uut, abLimits.a, abLimits.b, fail=True) - uut.setCurrentLimits(0) + uut.loadLimits(0) checkLimits(uut, abLimits.a, abLimits.b) @@ -150,7 +150,7 @@ def test_clearAbController(): uut = ABController() for s in songsWithLimits: - uut.addLimits(s[1].a, s[1].b, s[0]) + uut.storeLimits(s[1].a, s[1].b, s[0]) for i, s in enumerate(songsWithLimits): assert uut.getLimits(s[0]) == [s[1]] @@ -160,3 +160,9 @@ def test_clearAbController(): for i, s in enumerate(songsWithLimits): assert uut.getLimits(s[0]) == None +def test_setTemporaryLimits(): + pass + +def test_defaultBehaviour(): + uut = ABController() + |