Add test for 'lsinfo' command
This commit is contained in:
parent
b022a7d4b7
commit
c5f6c4c2a6
@ -136,9 +136,7 @@ class MpdHandler(object):
|
|||||||
|
|
||||||
@register(r'^lsinfo( "(?P<uri>[^"]*)")*$')
|
@register(r'^lsinfo( "(?P<uri>[^"]*)")*$')
|
||||||
def _lsinfo(self, uri):
|
def _lsinfo(self, uri):
|
||||||
if uri == u'/':
|
if uri == u'/' or uri is None:
|
||||||
return self._listplaylists()
|
|
||||||
elif uri is None:
|
|
||||||
return self._listplaylists()
|
return self._listplaylists()
|
||||||
pass # TODO
|
pass # TODO
|
||||||
|
|
||||||
|
|||||||
@ -443,15 +443,20 @@ class MusicDatabaseHandlerTest(unittest.TestCase):
|
|||||||
result = self.h.handle_request(u'listallinfo "file:///dev/urandom"')
|
result = self.h.handle_request(u'listallinfo "file:///dev/urandom"')
|
||||||
self.assert_(result is None)
|
self.assert_(result is None)
|
||||||
|
|
||||||
|
def test_lsinfo_without_path_returns_same_as_listplaylists(self):
|
||||||
|
lsinfo_result = self.h.handle_request(u'lsinfo')
|
||||||
|
listplaylists_result = self.h.handle_request(u'listplaylists')
|
||||||
|
self.assertEquals(lsinfo_result, listplaylists_result)
|
||||||
|
|
||||||
|
def test_lsinfo_with_path(self):
|
||||||
|
result = self.h.handle_request(u'lsinfo ""')
|
||||||
|
self.assert_(result is None)
|
||||||
|
|
||||||
def test_lsinfo_for_root_returns_same_as_listplaylists(self):
|
def test_lsinfo_for_root_returns_same_as_listplaylists(self):
|
||||||
lsinfo_result = self.h.handle_request(u'lsinfo "/"')
|
lsinfo_result = self.h.handle_request(u'lsinfo "/"')
|
||||||
listplaylists_result = self.h.handle_request(u'listplaylists')
|
listplaylists_result = self.h.handle_request(u'listplaylists')
|
||||||
self.assertEquals(lsinfo_result, listplaylists_result)
|
self.assertEquals(lsinfo_result, listplaylists_result)
|
||||||
|
|
||||||
def test_lsinfo(self):
|
|
||||||
result = self.h.handle_request(u'lsinfo ""')
|
|
||||||
self.assert_(result is None)
|
|
||||||
|
|
||||||
def test_search_album(self):
|
def test_search_album(self):
|
||||||
result = self.h.handle_request(u'search album analbum')
|
result = self.h.handle_request(u'search album analbum')
|
||||||
self.assert_(result is None)
|
self.assert_(result is None)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user