MPD: Handle 'lsinfo ""' in the same way as 'lsinfo' and 'lsinfo "/"'

This commit is contained in:
Stein Magnus Jodal 2010-05-05 12:54:49 +02:00
parent 5449374fa2
commit b408751520
2 changed files with 9 additions and 4 deletions

View File

@ -679,8 +679,12 @@ class MpdFrontend(object):
When listing the root directory, this currently returns the list of
stored playlists. This behavior is deprecated; use
``listplaylists`` instead.
MPD returns the same result, including both playlists and the files and
directories located at the root level, for both ``lsinfo``, ``lsinfo
""``, and ``lsinfo "/"``.
"""
if uri == u'/' or uri is None:
if uri is None or uri == u'/' or uri == u'':
return self._stored_playlists_listplaylists()
raise MpdNotImplemented # TODO

View File

@ -964,9 +964,10 @@ class MusicDatabaseHandlerTest(unittest.TestCase):
listplaylists_result = self.h.handle_request(u'listplaylists')
self.assertEqual(lsinfo_result, listplaylists_result)
def test_lsinfo_with_path(self):
result = self.h.handle_request(u'lsinfo ""')
self.assert_(u'ACK Not implemented' in result)
def test_lsinfo_with_empty_path_returns_same_as_listplaylists(self):
lsinfo_result = self.h.handle_request(u'lsinfo ""')
listplaylists_result = self.h.handle_request(u'listplaylists')
self.assertEqual(lsinfo_result, listplaylists_result)
def test_lsinfo_for_root_returns_same_as_listplaylists(self):
lsinfo_result = self.h.handle_request(u'lsinfo "/"')