aboutsummaryrefslogtreecommitdiffstats
path: root/playlist_unittest.py
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2021-12-22 22:14:43 +0100
committerEddy Pedroni <eddy@0xf7.com>2021-12-22 22:14:43 +0100
commit71593d438dff1a54986c94b469faa31c4581f6c7 (patch)
treed9209575ef368d015728937b47c5601ed3268bec /playlist_unittest.py
parent5f7e75ae1e53d3833114880d20e899629d21e31a (diff)
Fixed additive loading issue
Diffstat (limited to 'playlist_unittest.py')
-rw-r--r--playlist_unittest.py19
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
+