Test behaviour when errors happens during command_list processing
This commit is contained in:
parent
39c44bfed6
commit
4e16e403d2
@ -70,6 +70,15 @@ class MpdHandler(object):
|
|||||||
response.append(u'OK')
|
response.append(u'OK')
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
@register(r'^ack$')
|
||||||
|
def _ack(self):
|
||||||
|
"""
|
||||||
|
Always returns an 'ACK' and not 'OK'.
|
||||||
|
|
||||||
|
Not a part of the MPD protocol.
|
||||||
|
"""
|
||||||
|
raise MpdNotImplemented
|
||||||
|
|
||||||
@register(r'^add "(?P<uri>[^"]*)"$')
|
@register(r'^add "(?P<uri>[^"]*)"$')
|
||||||
def _add(self, uri):
|
def _add(self, uri):
|
||||||
raise MpdNotImplemented # TODO
|
raise MpdNotImplemented # TODO
|
||||||
|
|||||||
@ -66,6 +66,12 @@ class CommandListsTest(unittest.TestCase):
|
|||||||
self.assert_(u'OK' in result)
|
self.assert_(u'OK' in result)
|
||||||
self.assertEquals(False, self.h.command_list)
|
self.assertEquals(False, self.h.command_list)
|
||||||
|
|
||||||
|
def test_command_list_with_error(self):
|
||||||
|
self.h.handle_request(u'command_list_begin')
|
||||||
|
self.h.handle_request(u'ack')
|
||||||
|
result = self.h.handle_request(u'command_list_end')
|
||||||
|
self.assert_(u'ACK' in result[-1])
|
||||||
|
|
||||||
def test_command_list_ok_begin(self):
|
def test_command_list_ok_begin(self):
|
||||||
result = self.h.handle_request(u'command_list_ok_begin')
|
result = self.h.handle_request(u'command_list_ok_begin')
|
||||||
self.assert_(result is None)
|
self.assert_(result is None)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user