Return dict from _update()
This commit is contained in:
parent
13f0cea299
commit
c4aef48915
@ -354,7 +354,7 @@ class MpdHandler(object):
|
|||||||
|
|
||||||
@register(r'^update( "(?P<uri>[^"]+)")*$')
|
@register(r'^update( "(?P<uri>[^"]+)")*$')
|
||||||
def _update(self, uri=None, rescan_unmodified_files=False):
|
def _update(self, uri=None, rescan_unmodified_files=False):
|
||||||
return u'updating_db: 0' # TODO
|
return {'updating_db': 0} # TODO
|
||||||
|
|
||||||
@register(r'^urlhandlers$')
|
@register(r'^urlhandlers$')
|
||||||
def _urlhandlers(self):
|
def _urlhandlers(self):
|
||||||
|
|||||||
@ -502,31 +502,23 @@ class MusicDatabaseHandlerTest(unittest.TestCase):
|
|||||||
|
|
||||||
def test_update_without_uri(self):
|
def test_update_without_uri(self):
|
||||||
result = self.h.handle_request(u'update')
|
result = self.h.handle_request(u'update')
|
||||||
(label, jobid) = result.split(':', 1)
|
self.assert_('updating_db' in result)
|
||||||
self.assertEquals(u'updating_db', label)
|
self.assert_(result['updating_db'] >= 0)
|
||||||
self.assert_(jobid.strip().isdigit())
|
|
||||||
self.assert_(int(jobid) >= 0)
|
|
||||||
|
|
||||||
def test_update_with_uri(self):
|
def test_update_with_uri(self):
|
||||||
result = self.h.handle_request(u'update "file:///dev/urandom"')
|
result = self.h.handle_request(u'update "file:///dev/urandom"')
|
||||||
(label, jobid) = result.split(':', 1)
|
self.assert_('updating_db' in result)
|
||||||
self.assertEquals(u'updating_db', label)
|
self.assert_(result['updating_db'] >= 0)
|
||||||
self.assert_(jobid.strip().isdigit())
|
|
||||||
self.assert_(int(jobid) >= 0)
|
|
||||||
|
|
||||||
def test_rescan_without_uri(self):
|
def test_rescan_without_uri(self):
|
||||||
result = self.h.handle_request(u'rescan')
|
result = self.h.handle_request(u'rescan')
|
||||||
(label, jobid) = result.split(':', 1)
|
self.assert_('updating_db' in result)
|
||||||
self.assertEquals(u'updating_db', label)
|
self.assert_(result['updating_db'] >= 0)
|
||||||
self.assert_(jobid.strip().isdigit())
|
|
||||||
self.assert_(int(jobid) >= 0)
|
|
||||||
|
|
||||||
def test_rescan_with_uri(self):
|
def test_rescan_with_uri(self):
|
||||||
result = self.h.handle_request(u'rescan "file:///dev/urandom"')
|
result = self.h.handle_request(u'rescan "file:///dev/urandom"')
|
||||||
(label, jobid) = result.split(':', 1)
|
self.assert_('updating_db' in result)
|
||||||
self.assertEquals(u'updating_db', label)
|
self.assert_(result['updating_db'] >= 0)
|
||||||
self.assert_(jobid.strip().isdigit())
|
|
||||||
self.assert_(int(jobid) >= 0)
|
|
||||||
|
|
||||||
|
|
||||||
class StickersHandlerTest(unittest.TestCase):
|
class StickersHandlerTest(unittest.TestCase):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user