diff options
Diffstat (limited to 'abcontroller_unittest.py')
-rw-r--r-- | abcontroller_unittest.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/abcontroller_unittest.py b/abcontroller_unittest.py index fbe7ae1..b2b2a67 100644 --- a/abcontroller_unittest.py +++ b/abcontroller_unittest.py @@ -29,6 +29,9 @@ def checkLimits(uut, aLimit, bLimit, fail=False): TCase(bLimit + 0.1, aLimit if not fail else None) ] _checkLimits(uut, tests) + if not fail: + assert uut.getCurrentLimits()[0] == aLimit + assert uut.getCurrentLimits()[1] == bLimit def checkDefaultLimits(uut): tests = [ @@ -47,7 +50,7 @@ def test_oneSetOfLimits(): uut.loadLimits(0) checkLimits(uut, abLimits.a, abLimits.b) - assert uut.getLimits(song) == [abLimits] + assert uut.getStoredLimits(song) == [abLimits] def test_multipleSetsOfLimits(): song = "/path/to/song" @@ -66,7 +69,7 @@ def test_multipleSetsOfLimits(): uut.loadLimits(i) checkLimits(uut, l.a, l.b) - assert uut.getLimits(song) == abLimits + assert uut.getStoredLimits(song) == abLimits def test_multipleSongs(): songs = [ @@ -86,7 +89,7 @@ def test_multipleSongs(): uut.loadLimits(0) checkLimits(uut, abLimits[i].a, abLimits[i].b) - assert uut.getLimits(s) == [abLimits[i]] + assert uut.getStoredLimits(s) == [abLimits[i]] def test_disableAbRepeat(): song = "/path/to/song" @@ -147,10 +150,10 @@ def test_storeLimitsToCurrentSongButDoNotSetCurrentLimits(): checkLimits(uut, abLimits.a, abLimits.b) -def test_getLimitsOfInexistentSong(): +def test_getStoredLimitsOfInexistentSong(): song = "/path/to/song" uut = ABController() - assert uut.getLimits(song) == None + assert uut.getStoredLimits(song) == None def test_clearAbController(): songsWithLimits = [ @@ -163,12 +166,12 @@ def test_clearAbController(): uut.storeLimits(s[1].a, s[1].b, s[0]) for i, s in enumerate(songsWithLimits): - assert uut.getLimits(s[0]) == [s[1]] + assert uut.getStoredLimits(s[0]) == [s[1]] uut.clear() for i, s in enumerate(songsWithLimits): - assert uut.getLimits(s[0]) == None + assert uut.getStoredLimits(s[0]) == None def test_setTemporaryLimits(): abLimits = [ |