diff options
author | Eddy Pedroni <epedroni@pm.me> | 2025-02-22 11:26:27 +0100 |
---|---|---|
committer | Eddy Pedroni <epedroni@pm.me> | 2025-02-22 11:26:27 +0100 |
commit | e6f712c656365241434a71983024ac2a6e829cc8 (patch) | |
tree | 5bc9ac292834067aa3c1640165d050ff61aed399 /solo-tool-project/test/playlist_unittest.py | |
parent | 336ee67aa4b6c467d3d936124db16ce7dcd5a3b3 (diff) |
Removed playlist class, simplified a bunch of stuff
Diffstat (limited to 'solo-tool-project/test/playlist_unittest.py')
-rw-r--r-- | solo-tool-project/test/playlist_unittest.py | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/solo-tool-project/test/playlist_unittest.py b/solo-tool-project/test/playlist_unittest.py deleted file mode 100644 index 4b0186b..0000000 --- a/solo-tool-project/test/playlist_unittest.py +++ /dev/null @@ -1,103 +0,0 @@ -from solo_tool.playlist import Playlist - -def test_addAndSelectOneSong(): - songAddedByUser = "/path/to/song" - songSetByCallback = None - - def testCallback(song): - nonlocal songSetByCallback - songSetByCallback = song - - uut = Playlist(testCallback) - uut.addSong(songAddedByUser) - uut.setCurrentSong(0) - - assert songAddedByUser == songSetByCallback - assert uut.getCurrentSong() == songAddedByUser - assert uut.getCurrentSongIndex() == 0 - assert uut.getSongs() == [songAddedByUser] - -def test_addTwoSongsAndSelectBoth(): - songAddedByUser = ["/path/to/song", "/path/to/second/song"] - songSetByCallback = None - - def testCallback(song): - nonlocal songSetByCallback - songSetByCallback = song - - 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() == songAddedByUser[0] - assert uut.getCurrentSongIndex() == 0 - - uut.setCurrentSong(1) - assert songAddedByUser[1] == songSetByCallback - assert uut.getCurrentSong() == songAddedByUser[1] - assert uut.getCurrentSongIndex() == 1 - -def test_firstAddedSongIsNotSelected(): - songAddedByUser = "/path/to/song" - songSetByCallback = None - - def testCallback(song): - nonlocal songSetByCallback - songSetByCallback = song - - uut = Playlist(testCallback) - uut.addSong(songAddedByUser) - - assert songSetByCallback == None - assert uut.getCurrentSong() == None - assert uut.getCurrentSongIndex() == None - assert uut.getSongs() == [songAddedByUser] - -def test_invalidSongSelection(): - songAddedByUser = "/path/to/song" - songSetByCallback = None - - def testCallback(song): - nonlocal songSetByCallback - songSetByCallback = song - - uut = Playlist(testCallback) - assert songSetByCallback == None - assert uut.getCurrentSong() == None - assert uut.getCurrentSongIndex() == None - - uut.setCurrentSong(10) - assert songSetByCallback == None - assert uut.getCurrentSong() == None - assert uut.getCurrentSongIndex() == None - - uut.addSong(songAddedByUser) - uut.setCurrentSong(10) - assert songSetByCallback == None - assert uut.getCurrentSong() == None - assert uut.getCurrentSongIndex() == None - assert uut.getSongs() == [songAddedByUser] - -def test_clearPlaylist(): - songAddedByUser = ["/path/to/song", "/path/to/second/song"] - - def dummy(index): - pass - - uut = Playlist(dummy) - for s in songAddedByUser: - uut.addSong(s) - uut.setCurrentSong(0) - - assert uut.getSongs() == songAddedByUser - assert uut.getCurrentSong() == songAddedByUser[0] - assert uut.getCurrentSongIndex() == 0 - - uut.clear() - - assert uut.getSongs() == [] - assert uut.getCurrentSong() == None - assert uut.getCurrentSongIndex() == None |