mpd: Allow bad 'find' requests

This commit is contained in:
Stein Magnus Jodal 2012-11-20 00:38:53 +01:00
parent 7da2058b65
commit bec91284be
2 changed files with 5 additions and 1 deletions

View File

@ -52,7 +52,7 @@ def count(context, tag, needle):
@handle_request(
r'^find (?P<mpd_query>("?([Aa]lbum|[Aa]rtist|[Dd]ate|[Ff]ile[name]*|'
r'[Tt]itle|[Aa]ny)"? "[^"]+"\s?)+)$')
r'[Tt]itle|[Aa]ny)"? "[^"]*"\s?)+)$')
def find(context, mpd_query):
"""
*musicpd.org, music database section:*

View File

@ -119,6 +119,10 @@ class MusicDatabaseFindTest(protocol.BaseTestCase):
self.sendRequest('find album "album_what" artist "artist_what"')
self.assertInResponse('OK')
def test_find_without_filter_value(self):
self.sendRequest('find "album" ""')
self.assertInResponse('OK')
class MusicDatabaseListTest(protocol.BaseTestCase):
def test_list_foo_returns_ack(self):