Revision 09127904

b/test/ganeti.rapi.client_unittest.py
107 107
      HandlerClass, items, args = self._mapper.getController(path)
108 108
      self._last_handler = HandlerClass(items, args, None)
109 109
      if not hasattr(self._last_handler, method.upper()):
110
        code = 400
111
        response = "Bad request"
110
        code = 501
111
        response = "Method not implemented"
112 112
    except http.HttpException, ex:
113 113
      code = ex.code
114 114
      response = ex.message
......
120 120

  
121 121

  
122 122
class RapiMockTest(unittest.TestCase):
123

  
124 123
  def test(self):
125 124
    rapi = RapiMock()
126 125
    path = "/version"
127 126
    self.assertEqual((404, None), rapi.FetchResponse("/foo", "GET"))
128
    self.assertEqual((400, "Bad request"),
127
    self.assertEqual((501, "Method not implemented"),
129 128
                     rapi.FetchResponse("/version", "POST"))
130 129
    rapi.AddResponse("2")
131 130
    code, response = rapi.FetchResponse("/version", "GET")

Also available in: Unified diff