From c83ac35758a413a0a6355edcd6671e69a04e6f4d Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 3 Aug 2010 09:07:33 +0200 Subject: [PATCH] MPD: Add more docs and tests to 'playlistsearch' --- mopidy/mpd/frontend.py | 6 ++++++ tests/mpd/current_playlist_test.py | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mopidy/mpd/frontend.py b/mopidy/mpd/frontend.py index 259271f3..bddeef8a 100644 --- a/mopidy/mpd/frontend.py +++ b/mopidy/mpd/frontend.py @@ -474,6 +474,7 @@ class MpdFrontend(object): return self.backend.current_playlist.mpd_format(start, end) @handle_pattern(r'^playlistsearch "(?P[^"]+)" "(?P[^"]+)"$') + @handle_pattern(r'^playlistsearch (?P\S+) "(?P[^"]+)"$') def _current_playlist_playlistsearch(self, tag, needle): """ *musicpd.org, current playlist section:* @@ -482,6 +483,11 @@ class MpdFrontend(object): Searches case-sensitively for partial matches in the current playlist. + + *GMPC:* + + - does not add quotes around the tag + - uses ``filename`` and ``any`` as tags """ raise MpdNotImplemented # TODO diff --git a/tests/mpd/current_playlist_test.py b/tests/mpd/current_playlist_test.py index 4372ed19..e8dd9748 100644 --- a/tests/mpd/current_playlist_test.py +++ b/tests/mpd/current_playlist_test.py @@ -304,7 +304,11 @@ class CurrentPlaylistHandlerTest(unittest.TestCase): self.assert_(u'OK' in result) def test_playlistsearch(self): - result = self.h.handle_request(u'playlistsearch "tag" "needle"') + result = self.h.handle_request(u'playlistsearch "any" "needle"') + self.assert_(u'ACK [0@0] {} Not implemented' in result) + + def test_playlistsearch_without_quotes(self): + result = self.h.handle_request(u'playlistsearch any "needle"') self.assert_(u'ACK [0@0] {} Not implemented' in result) def test_plchanges(self):