From 71593d438dff1a54986c94b469faa31c4581f6c7 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Wed, 22 Dec 2021 22:14:43 +0100 Subject: Fixed additive loading issue --- playlist_unittest.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'playlist_unittest.py') 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 + -- cgit v1.2.3