aboutsummaryrefslogtreecommitdiffstats
path: root/playlist_unittest.py
diff options
context:
space:
mode:
Diffstat (limited to 'playlist_unittest.py')
-rw-r--r--playlist_unittest.py21
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]