Commit 09127904 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

RAPI client: Fix error message for unsupported methods in unittest

Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarDavid Knowles <>
parent d9b67f70
......@@ -107,8 +107,8 @@ class RapiMock(object):
HandlerClass, items, args = self._mapper.getController(path)
self._last_handler = HandlerClass(items, args, None)
if not hasattr(self._last_handler, method.upper()):
code = 400
response = "Bad request"
code = 501
response = "Method not implemented"
except http.HttpException, ex:
code = ex.code
response = ex.message
......@@ -120,12 +120,11 @@ class RapiMock(object):
class RapiMockTest(unittest.TestCase):
def test(self):
rapi = RapiMock()
path = "/version"
self.assertEqual((404, None), rapi.FetchResponse("/foo", "GET"))
self.assertEqual((400, "Bad request"),
self.assertEqual((501, "Method not implemented"),
rapi.FetchResponse("/version", "POST"))
code, response = rapi.FetchResponse("/version", "GET")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment