diff --git a/docs/changes.rst b/docs/changes.rst index 01b3c5bc..dfe46951 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -81,10 +81,11 @@ greatly improved MPD client support. - :meth:`mopidy.backends.base.BaseLibraryController.search()` now accepts keyword arguments of the form ``search(artist=['foo', 'fighters'], album=['bar', 'grooves'])``. - - :meth:`mopidy.backends.base.BaseCurrentPlaylistController.load()` now - appends to the existing playlist. Use + - :meth:`mopidy.backends.base.BaseCurrentPlaylistController.append()` + replaces + :meth:`mopidy.backends.base.BaseCurrentPlaylistController.load()`. Use :meth:`mopidy.backends.base.BaseCurrentPlaylistController.clear()` if you - want to clear it first. + want to clear the current playlist. - The following fields in :class:`mopidy.backends.base.BasePlaybackController` has been renamed to reflect their relation to methods called on the controller: diff --git a/mopidy/backends/base/current_playlist.py b/mopidy/backends/base/current_playlist.py index 8aefe8cd..c8c83a62 100644 --- a/mopidy/backends/base/current_playlist.py +++ b/mopidy/backends/base/current_playlist.py @@ -64,6 +64,18 @@ class BaseCurrentPlaylistController(object): self.version += 1 return cp_track + def append(self, tracks): + """ + Append the given tracks to the current playlist. + + :param tracks: tracks to append + :type tracks: list of :class:`mopidy.models.Track` + """ + self.version += 1 + for track in tracks: + self.add(track) + self.backend.playback.on_current_playlist_change() + def clear(self): """Clear the current playlist.""" self._cp_tracks = [] @@ -104,18 +116,6 @@ class BaseCurrentPlaylistController(object): else: raise LookupError(u'"%s" match multiple tracks' % criteria_string) - def load(self, tracks): - """ - Append the given tracks to the current playlist. - - :param tracks: tracks to load - :type tracks: list of :class:`mopidy.models.Track` - """ - self.version += 1 - for track in tracks: - self.add(track) - self.backend.playback.on_current_playlist_change() - def move(self, start, end, to_position): """ Move the tracks in the slice ``[start:end]`` to ``to_position``. diff --git a/mopidy/frontends/mpd/protocol/current_playlist.py b/mopidy/frontends/mpd/protocol/current_playlist.py index 17b019e9..89376945 100644 --- a/mopidy/frontends/mpd/protocol/current_playlist.py +++ b/mopidy/frontends/mpd/protocol/current_playlist.py @@ -342,7 +342,7 @@ def swap(frontend, songpos1, songpos2): del tracks[songpos2] tracks.insert(songpos2, song1) frontend.backend.current_playlist.clear() - frontend.backend.current_playlist.load(tracks) + frontend.backend.current_playlist.append(tracks) @handle_pattern(r'^swapid "(?P\d+)" "(?P\d+)"$') def swapid(frontend, cpid1, cpid2): diff --git a/mopidy/frontends/mpd/protocol/stored_playlists.py b/mopidy/frontends/mpd/protocol/stored_playlists.py index adc455c3..25ae4c32 100644 --- a/mopidy/frontends/mpd/protocol/stored_playlists.py +++ b/mopidy/frontends/mpd/protocol/stored_playlists.py @@ -93,7 +93,7 @@ def load(frontend, name): """ matches = frontend.backend.stored_playlists.search(name) if matches: - frontend.backend.current_playlist.load(matches[0].tracks) + frontend.backend.current_playlist.append(matches[0].tracks) @handle_pattern(r'^playlistadd "(?P[^"]+)" "(?P[^"]+)"$') def playlistadd(frontend, name, uri): diff --git a/tests/frontends/mpd/current_playlist_test.py b/tests/frontends/mpd/current_playlist_test.py index 6b5c822e..a063b513 100644 --- a/tests/frontends/mpd/current_playlist_test.py +++ b/tests/frontends/mpd/current_playlist_test.py @@ -13,7 +13,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): def test_add(self): needle = Track(uri='dummy://foo') self.b.library._library = [Track(), Track(), needle, Track()] - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(), Track(), Track(), Track(), Track()]) self.assertEqual(len(self.b.current_playlist.tracks), 5) result = self.h.handle_request(u'add "dummy://foo"') @@ -30,7 +30,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): def test_addid_without_songpos(self): needle = Track(uri='dummy://foo') self.b.library._library = [Track(), Track(), needle, Track()] - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(), Track(), Track(), Track(), Track()]) self.assertEqual(len(self.b.current_playlist.tracks), 5) result = self.h.handle_request(u'addid "dummy://foo"') @@ -43,7 +43,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): def test_addid_with_songpos(self): needle = Track(uri='dummy://foo') self.b.library._library = [Track(), Track(), needle, Track()] - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(), Track(), Track(), Track(), Track()]) self.assertEqual(len(self.b.current_playlist.tracks), 5) result = self.h.handle_request(u'addid "dummy://foo" "3"') @@ -56,7 +56,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): def test_addid_with_songpos_out_of_bounds_should_ack(self): needle = Track(uri='dummy://foo') self.b.library._library = [Track(), Track(), needle, Track()] - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(), Track(), Track(), Track(), Track()]) self.assertEqual(len(self.b.current_playlist.tracks), 5) result = self.h.handle_request(u'addid "dummy://foo" "6"') @@ -67,7 +67,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assertEqual(result[0], u'ACK [50@0] {addid} No such song') def test_clear(self): - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(), Track(), Track(), Track(), Track()]) self.assertEqual(len(self.b.current_playlist.tracks), 5) result = self.h.handle_request(u'clear') @@ -76,7 +76,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_delete_songpos(self): - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(), Track(), Track(), Track(), Track()]) self.assertEqual(len(self.b.current_playlist.tracks), 5) result = self.h.handle_request(u'delete "%d"' % @@ -85,7 +85,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_delete_songpos_out_of_bounds(self): - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(), Track(), Track(), Track(), Track()]) self.assertEqual(len(self.b.current_playlist.tracks), 5) result = self.h.handle_request(u'delete "5"') @@ -93,7 +93,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assertEqual(result[0], u'ACK [2@0] {delete} Bad song index') def test_delete_open_range(self): - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(), Track(), Track(), Track(), Track()]) self.assertEqual(len(self.b.current_playlist.tracks), 5) result = self.h.handle_request(u'delete "1:"') @@ -101,7 +101,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_delete_closed_range(self): - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(), Track(), Track(), Track(), Track()]) self.assertEqual(len(self.b.current_playlist.tracks), 5) result = self.h.handle_request(u'delete "1:3"') @@ -109,7 +109,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_delete_range_out_of_bounds(self): - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(), Track(), Track(), Track(), Track()]) self.assertEqual(len(self.b.current_playlist.tracks), 5) result = self.h.handle_request(u'delete "5:7"') @@ -117,21 +117,21 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assertEqual(result[0], u'ACK [2@0] {delete} Bad song index') def test_deleteid(self): - self.b.current_playlist.load([Track(), Track()]) + self.b.current_playlist.append([Track(), Track()]) self.assertEqual(len(self.b.current_playlist.tracks), 2) result = self.h.handle_request(u'deleteid "2"') self.assertEqual(len(self.b.current_playlist.tracks), 1) self.assert_(u'OK' in result) def test_deleteid_does_not_exist(self): - self.b.current_playlist.load([Track(), Track()]) + self.b.current_playlist.append([Track(), Track()]) self.assertEqual(len(self.b.current_playlist.tracks), 2) result = self.h.handle_request(u'deleteid "12345"') self.assertEqual(len(self.b.current_playlist.tracks), 2) self.assertEqual(result[0], u'ACK [50@0] {deleteid} No such song') def test_move_songpos(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) @@ -145,7 +145,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_move_open_range(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) @@ -159,7 +159,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_move_closed_range(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) @@ -173,7 +173,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_moveid(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) @@ -208,7 +208,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_playlistfind_by_filename_in_current_playlist(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(uri='file:///exists')]) result = self.h.handle_request( u'playlistfind filename "file:///exists"') @@ -218,14 +218,14 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_playlistid_without_songid(self): - self.b.current_playlist.load([Track(name='a'), Track(name='b')]) + self.b.current_playlist.append([Track(name='a'), Track(name='b')]) result = self.h.handle_request(u'playlistid') self.assert_(u'Title: a' in result) self.assert_(u'Title: b' in result) self.assert_(u'OK' in result) def test_playlistid_with_songid(self): - self.b.current_playlist.load([Track(name='a'), Track(name='b')]) + self.b.current_playlist.append([Track(name='a'), Track(name='b')]) result = self.h.handle_request(u'playlistid "2"') self.assert_(u'Title: a' not in result) self.assert_(u'Id: 1' not in result) @@ -234,12 +234,12 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_playlistid_with_not_existing_songid_fails(self): - self.b.current_playlist.load([Track(name='a'), Track(name='b')]) + self.b.current_playlist.append([Track(name='a'), Track(name='b')]) result = self.h.handle_request(u'playlistid "25"') self.assertEqual(result[0], u'ACK [50@0] {playlistid} No such song') def test_playlistinfo_without_songpos_or_range(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) @@ -253,7 +253,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_playlistinfo_with_songpos(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) @@ -272,7 +272,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assertEqual(result1, result2) def test_playlistinfo_with_open_range(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) @@ -286,7 +286,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_playlistinfo_with_closed_range(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) @@ -316,7 +316,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'ACK [0@0] {} Not implemented' in result) def test_plchanges(self): - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(name='a'), Track(name='b'), Track(name='c')]) result = self.h.handle_request(u'plchanges "0"') self.assert_(u'Title: a' in result) @@ -325,7 +325,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_plchanges_with_minus_one_returns_entire_playlist(self): - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(name='a'), Track(name='b'), Track(name='c')]) result = self.h.handle_request(u'plchanges "-1"') self.assert_(u'Title: a' in result) @@ -334,7 +334,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_plchanges_without_quotes_works(self): - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(name='a'), Track(name='b'), Track(name='c')]) result = self.h.handle_request(u'plchanges 0') self.assert_(u'Title: a' in result) @@ -343,7 +343,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_plchangesposid(self): - self.b.current_playlist.load([Track(), Track(), Track()]) + self.b.current_playlist.append([Track(), Track(), Track()]) result = self.h.handle_request(u'plchangesposid "0"') self.assert_(u'cpos: 0' in result) self.assert_(u'Id: %d' % self.b.current_playlist.cp_tracks[0][0] @@ -357,7 +357,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_shuffle_without_range(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) @@ -367,7 +367,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_shuffle_with_open_range(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) @@ -381,7 +381,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_shuffle_with_closed_range(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) @@ -395,7 +395,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_swap(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) @@ -409,7 +409,7 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_swapid(self): - self.b.current_playlist.load([ + self.b.current_playlist.append([ Track(name='a'), Track(name='b'), Track(name='c'), Track(name='d'), Track(name='e'), Track(name='f'), ]) diff --git a/tests/frontends/mpd/playback_test.py b/tests/frontends/mpd/playback_test.py index ce3130bf..17263aef 100644 --- a/tests/frontends/mpd/playback_test.py +++ b/tests/frontends/mpd/playback_test.py @@ -174,7 +174,7 @@ class PlaybackControlHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_pause_off(self): - self.b.current_playlist.load([Track()]) + self.b.current_playlist.append([Track()]) self.h.handle_request(u'play "0"') self.h.handle_request(u'pause "1"') result = self.h.handle_request(u'pause "0"') @@ -182,14 +182,14 @@ class PlaybackControlHandlerTest(unittest.TestCase): self.assertEqual(self.b.playback.PLAYING, self.b.playback.state) def test_pause_on(self): - self.b.current_playlist.load([Track()]) + self.b.current_playlist.append([Track()]) self.h.handle_request(u'play "0"') result = self.h.handle_request(u'pause "1"') self.assert_(u'OK' in result) self.assertEqual(self.b.playback.PAUSED, self.b.playback.state) def test_pause_toggle(self): - self.b.current_playlist.load([Track()]) + self.b.current_playlist.append([Track()]) result = self.h.handle_request(u'play "0"') self.assert_(u'OK' in result) self.assertEqual(self.b.playback.PLAYING, self.b.playback.state) @@ -201,40 +201,40 @@ class PlaybackControlHandlerTest(unittest.TestCase): self.assertEqual(self.b.playback.PLAYING, self.b.playback.state) def test_play_without_pos(self): - self.b.current_playlist.load([Track()]) + self.b.current_playlist.append([Track()]) self.b.playback.state = self.b.playback.PAUSED result = self.h.handle_request(u'play') self.assert_(u'OK' in result) self.assertEqual(self.b.playback.PLAYING, self.b.playback.state) def test_play_with_pos(self): - self.b.current_playlist.load([Track()]) + self.b.current_playlist.append([Track()]) result = self.h.handle_request(u'play "0"') self.assert_(u'OK' in result) self.assertEqual(self.b.playback.PLAYING, self.b.playback.state) def test_play_with_pos_without_quotes(self): - self.b.current_playlist.load([Track()]) + self.b.current_playlist.append([Track()]) result = self.h.handle_request(u'play 0') self.assert_(u'OK' in result) self.assertEqual(self.b.playback.PLAYING, self.b.playback.state) def test_play_with_pos_out_of_bounds(self): - self.b.current_playlist.load([]) + self.b.current_playlist.append([]) result = self.h.handle_request(u'play "0"') self.assertEqual(result[0], u'ACK [2@0] {play} Bad song index') self.assertEqual(self.b.playback.STOPPED, self.b.playback.state) def test_play_minus_one_plays_first_in_playlist_if_no_current_track(self): self.assertEqual(self.b.playback.current_track, None) - self.b.current_playlist.load([Track(uri='a'), Track(uri='b')]) + self.b.current_playlist.append([Track(uri='a'), Track(uri='b')]) result = self.h.handle_request(u'play "-1"') self.assert_(u'OK' in result) self.assertEqual(self.b.playback.PLAYING, self.b.playback.state) self.assertEqual(self.b.playback.current_track.uri, 'a') def test_play_minus_one_plays_current_track_if_current_track_is_set(self): - self.b.current_playlist.load([Track(uri='a'), Track(uri='b')]) + self.b.current_playlist.append([Track(uri='a'), Track(uri='b')]) self.assertEqual(self.b.playback.current_track, None) self.b.playback.play() self.b.playback.next() @@ -253,21 +253,21 @@ class PlaybackControlHandlerTest(unittest.TestCase): self.assertEqual(self.b.playback.current_track, None) def test_playid(self): - self.b.current_playlist.load([Track()]) + self.b.current_playlist.append([Track()]) result = self.h.handle_request(u'playid "1"') self.assert_(u'OK' in result) self.assertEqual(self.b.playback.PLAYING, self.b.playback.state) def test_playid_minus_one_plays_first_in_playlist_if_no_current_track(self): self.assertEqual(self.b.playback.current_track, None) - self.b.current_playlist.load([Track(uri='a'), Track(uri='b')]) + self.b.current_playlist.append([Track(uri='a'), Track(uri='b')]) result = self.h.handle_request(u'playid "-1"') self.assert_(u'OK' in result) self.assertEqual(self.b.playback.PLAYING, self.b.playback.state) self.assertEqual(self.b.playback.current_track.uri, 'a') def test_play_minus_one_plays_current_track_if_current_track_is_set(self): - self.b.current_playlist.load([Track(uri='a'), Track(uri='b')]) + self.b.current_playlist.append([Track(uri='a'), Track(uri='b')]) self.assertEqual(self.b.playback.current_track, None) self.b.playback.play() self.b.playback.next() @@ -286,7 +286,7 @@ class PlaybackControlHandlerTest(unittest.TestCase): self.assertEqual(self.b.playback.current_track, None) def test_playid_which_does_not_exist(self): - self.b.current_playlist.load([Track()]) + self.b.current_playlist.append([Track()]) result = self.h.handle_request(u'playid "12345"') self.assertEqual(result[0], u'ACK [50@0] {playid} No such song') @@ -295,7 +295,7 @@ class PlaybackControlHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_seek(self): - self.b.current_playlist.load([Track(length=40000)]) + self.b.current_playlist.append([Track(length=40000)]) self.h.handle_request(u'seek "0"') result = self.h.handle_request(u'seek "0" "30"') self.assert_(u'OK' in result) @@ -303,20 +303,20 @@ class PlaybackControlHandlerTest(unittest.TestCase): def test_seek_with_songpos(self): seek_track = Track(uri='2', length=40000) - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(uri='1', length=40000), seek_track]) result = self.h.handle_request(u'seek "1" "30"') self.assertEqual(self.b.playback.current_track, seek_track) def test_seekid(self): - self.b.current_playlist.load([Track(length=40000)]) + self.b.current_playlist.append([Track(length=40000)]) result = self.h.handle_request(u'seekid "1" "30"') self.assert_(u'OK' in result) self.assert_(self.b.playback.time_position >= 30000) def test_seekid_with_cpid(self): seek_track = Track(uri='2', length=40000) - self.b.current_playlist.load( + self.b.current_playlist.append( [Track(length=40000), seek_track]) result = self.h.handle_request(u'seekid "2" "30"') self.assertEqual(self.b.playback.current_cpid, 2) diff --git a/tests/frontends/mpd/status_test.py b/tests/frontends/mpd/status_test.py index 907788f5..9839acfe 100644 --- a/tests/frontends/mpd/status_test.py +++ b/tests/frontends/mpd/status_test.py @@ -16,7 +16,7 @@ class StatusHandlerTest(unittest.TestCase): def test_currentsong(self): track = Track() - self.b.current_playlist.load([track]) + self.b.current_playlist.append([track]) self.b.playback.play() result = self.h.handle_request(u'currentsong') self.assert_(u'file: ' in result) @@ -155,21 +155,21 @@ class StatusHandlerTest(unittest.TestCase): self.assertEqual(result['state'], 'pause') def test_status_method_when_playlist_loaded_contains_song(self): - self.b.current_playlist.load([Track()]) + self.b.current_playlist.append([Track()]) self.b.playback.play() result = dict(frontend.status.status(self.h)) self.assert_('song' in result) self.assert_(int(result['song']) >= 0) def test_status_method_when_playlist_loaded_contains_cpid_as_songid(self): - self.b.current_playlist.load([Track()]) + self.b.current_playlist.append([Track()]) self.b.playback.play() result = dict(frontend.status.status(self.h)) self.assert_('songid' in result) self.assertEqual(int(result['songid']), 1) def test_status_method_when_playing_contains_time_with_no_length(self): - self.b.current_playlist.load([Track(length=None)]) + self.b.current_playlist.append([Track(length=None)]) self.b.playback.play() result = dict(frontend.status.status(self.h)) self.assert_('time' in result) @@ -179,7 +179,7 @@ class StatusHandlerTest(unittest.TestCase): self.assert_(position <= total) def test_status_method_when_playing_contains_time_with_length(self): - self.b.current_playlist.load([Track(length=10000)]) + self.b.current_playlist.append([Track(length=10000)]) self.b.playback.play() result = dict(frontend.status.status(self.h)) self.assert_('time' in result) @@ -196,7 +196,7 @@ class StatusHandlerTest(unittest.TestCase): self.assertEqual(int(result['elapsed']), 59123) def test_status_method_when_playing_contains_bitrate(self): - self.b.current_playlist.load([Track(bitrate=320)]) + self.b.current_playlist.append([Track(bitrate=320)]) self.b.playback.play() result = dict(frontend.status.status(self.h)) self.assert_('bitrate' in result)