diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2021-12-21 08:16:55 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2021-12-21 08:16:55 +0100 |
commit | 182a14f4b9aec4722f7f94ab44bf57356c6d71aa (patch) | |
tree | c2c3a683184a53ddc141fe33e02fc934b793d196 /playlist_unittest.py | |
parent | 1ca1fbcc001e27f46fc033f44ad5459bd0351bc9 (diff) |
Added AB controller with some tests, minor refactor to playlist
Diffstat (limited to 'playlist_unittest.py')
-rw-r--r-- | playlist_unittest.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/playlist_unittest.py b/playlist_unittest.py index 685dcb0..b407e4d 100644 --- a/playlist_unittest.py +++ b/playlist_unittest.py @@ -13,6 +13,7 @@ def test_addAndSelectOneSong(): uut.setCurrentSong(0) assert songAddedByUser == songSetByCallback + assert uut.getCurrentSong() == 0 def test_addTwoSongsAndSelectBoth(): songAddedByUser = ["/path/to/song", "/path/to/second/song"] @@ -28,9 +29,11 @@ def test_addTwoSongsAndSelectBoth(): uut.setCurrentSong(0) assert songAddedByUser[0] == songSetByCallback + assert uut.getCurrentSong() == 0 uut.setCurrentSong(1) assert songAddedByUser[1] == songSetByCallback + assert uut.getCurrentSong() == 1 def test_firstAddedSongIsSelected(): songAddedByUser = "/path/to/song" @@ -44,6 +47,7 @@ def test_firstAddedSongIsSelected(): uut.addSong(songAddedByUser) assert songAddedByUser == songSetByCallback + assert uut.getCurrentSong() == 0 def test_invalidSongSelection(): songAddedByUser = "/path/to/song" @@ -58,8 +62,10 @@ def test_invalidSongSelection(): uut.setCurrentSong(10) assert songSetByCallback == None + assert uut.getCurrentSong() == None uut.addSong(songAddedByUser) uut.setCurrentSong(10) assert songSetByCallback == songAddedByUser + assert uut.getCurrentSong() == 0 |