diff options
Diffstat (limited to 'playlist_unittest.py')
-rw-r--r-- | playlist_unittest.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/playlist_unittest.py b/playlist_unittest.py index ff5a79c..9dd3700 100644 --- a/playlist_unittest.py +++ b/playlist_unittest.py @@ -74,3 +74,22 @@ def test_invalidSongSelection(): assert uut.getCurrentSong() == 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] + + uut.clear() + + assert uut.getSongs() == [] + assert uut.getCurrentSong() == None + |