diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-01-01 10:18:37 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-01-01 10:18:37 +0100 |
commit | 71f6a49110b6696ca6ac7956baa4edaa1aaa9527 (patch) | |
tree | e16178d2db8c6a8b7459801aab34d46255d4e8f6 /abcontroller_unittest.py | |
parent | 9090422b2ba5eab9e4131f9b9281ed83128d977c (diff) |
Added partial Launchpad support, refactored existing files
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 = [ |