Implement _current_playlist_clear

This commit is contained in:
Stein Magnus Jodal 2010-02-28 17:09:28 +01:00
parent 54f538555c
commit 7e94f69e6e
2 changed files with 6 additions and 2 deletions

View File

@ -302,7 +302,7 @@ class MpdHandler(object):
Clears the current playlist.
"""
raise MpdNotImplemented # TODO
self.backend.current_playlist.clear()
@handle_pattern(r'^move "(?P<songpos>\d+)" "(?P<to>\d+)"$')
@handle_pattern(r'^move "(?P<start>\d+):(?P<end>\d+)*" "(?P<to>\d+)"$')

View File

@ -529,8 +529,12 @@ class CurrentPlaylistHandlerTest(unittest.TestCase):
self.assert_(u'OK' in result)
def test_clear(self):
self.b.current_playlist.playlist = Playlist(
tracks=[Track(), Track(), Track(), Track(), Track()])
self.assertEquals(self.b.current_playlist.playlist.length, 5)
result = self.h.handle_request(u'clear')
self.assert_(u'ACK Not implemented' in result)
self.assertEquals(self.b.current_playlist.playlist.length, 0)
self.assert_(u'OK' in result)
def test_delete_songpos(self):
self.b.current_playlist.playlist = Playlist(