mpd: Deleting unkown playlist should return not found

This commit is contained in:
Thomas Adamcik 2015-12-05 12:48:14 +01:00
parent 593f4e295b
commit 98e19e803b
2 changed files with 6 additions and 0 deletions

View File

@ -328,6 +328,8 @@ def rm(context, name):
Removes the playlist ``NAME.m3u`` from the playlist directory.
"""
uri = context.lookup_playlist_uri_from_name(name)
if not uri:
raise exceptions.MpdNoExistError('No such playlist')
context.core.playlists.delete(uri).get()

View File

@ -330,6 +330,10 @@ class PlaylistsHandlerTest(protocol.BaseTestCase):
self.assertInResponse('OK')
self.assertIsNone(self.backend.playlists.lookup('dummy:a1').get())
def test_rm_unknown_playlist_acks(self):
self.send_request('rm "name"')
self.assertInResponse('ACK [50@0] {rm} No such playlist')
def test_save(self):
self.send_request('save "name"')