diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2021-12-21 18:24:55 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2021-12-21 18:24:55 +0100 |
commit | 6eb42e6d4468ad161281125c77a41063f93380e1 (patch) | |
tree | 35ad2edeb7058ad60f47affb1b27dfac3fa62bac /playlist_unittest.py | |
parent | c1bfcc6064b3a22c76b986d9339daf6cbd403c80 (diff) |
Added session manager, renamed solo-tool.py
Diffstat (limited to 'playlist_unittest.py')
-rw-r--r-- | playlist_unittest.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/playlist_unittest.py b/playlist_unittest.py index b407e4d..ff5a79c 100644 --- a/playlist_unittest.py +++ b/playlist_unittest.py @@ -13,7 +13,8 @@ def test_addAndSelectOneSong(): uut.setCurrentSong(0) assert songAddedByUser == songSetByCallback - assert uut.getCurrentSong() == 0 + assert uut.getCurrentSong() == songAddedByUser + assert uut.getSongs() == [songAddedByUser] def test_addTwoSongsAndSelectBoth(): songAddedByUser = ["/path/to/song", "/path/to/second/song"] @@ -26,16 +27,17 @@ def test_addTwoSongsAndSelectBoth(): uut = Playlist(testCallback) uut.addSong(songAddedByUser[0]) uut.addSong(songAddedByUser[1]) + assert uut.getSongs() == songAddedByUser uut.setCurrentSong(0) assert songAddedByUser[0] == songSetByCallback - assert uut.getCurrentSong() == 0 + assert uut.getCurrentSong() == songAddedByUser[0] uut.setCurrentSong(1) assert songAddedByUser[1] == songSetByCallback - assert uut.getCurrentSong() == 1 + assert uut.getCurrentSong() == songAddedByUser[1] -def test_firstAddedSongIsSelected(): +def test_firstAddedSongIsNotSelected(): songAddedByUser = "/path/to/song" songSetByCallback = None @@ -46,8 +48,9 @@ def test_firstAddedSongIsSelected(): uut = Playlist(testCallback) uut.addSong(songAddedByUser) - assert songAddedByUser == songSetByCallback - assert uut.getCurrentSong() == 0 + assert songSetByCallback == None + assert uut.getCurrentSong() == None + assert uut.getSongs() == [songAddedByUser] def test_invalidSongSelection(): songAddedByUser = "/path/to/song" @@ -59,6 +62,7 @@ def test_invalidSongSelection(): uut = Playlist(testCallback) assert songSetByCallback == None + assert uut.getCurrentSong() == None uut.setCurrentSong(10) assert songSetByCallback == None @@ -66,6 +70,7 @@ def test_invalidSongSelection(): uut.addSong(songAddedByUser) uut.setCurrentSong(10) - assert songSetByCallback == songAddedByUser - assert uut.getCurrentSong() == 0 + assert songSetByCallback == None + assert uut.getCurrentSong() == None + assert uut.getSongs() == [songAddedByUser] |