Add support for 'outputs' MPD command
This commit is contained in:
parent
552b3ac723
commit
01a6751ce6
@ -220,6 +220,14 @@ class MpdHandler(object):
|
||||
def _next(self):
|
||||
return self.backend.playback.next()
|
||||
|
||||
@register(r'^outputs$')
|
||||
def _outputs(self):
|
||||
return [
|
||||
('outputid', 0),
|
||||
('outputname', self.backend.__class__.__name__),
|
||||
('outputenabled', 1),
|
||||
]
|
||||
|
||||
@register(r'^password "(?P<password>[^"]+)"$')
|
||||
def _password(self, password):
|
||||
raise MpdNotImplemented # TODO
|
||||
|
||||
@ -774,11 +774,17 @@ class ConnectionHandlerTest(unittest.TestCase):
|
||||
result = self.h.handle_request(u'ping')
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
|
||||
class AudioOutputHandlerTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.h = handler.MpdHandler(backend=DummyBackend())
|
||||
|
||||
pass # TODO
|
||||
def test_outputs(self):
|
||||
result = self.h.handle_request(u'outputs')
|
||||
self.assert_(u'outputid: 0' in result)
|
||||
self.assert_(u'outputname: DummyBackend' in result)
|
||||
self.assert_(u'outputenabled: 1' in result)
|
||||
self.assert_(u'OK' in result)
|
||||
|
||||
|
||||
class ReflectionHandlerTest(unittest.TestCase):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user