Exemplo n.º 1
0
 def test_MAASAPIException_produces_http_response(self):
     error = factory.getRandomString()
     exception = MAASAPIBadRequest(error)
     response = exception.make_http_response()
     self.assertEqual(
         (httplib.BAD_REQUEST, error),
         (response.status_code, response.content))
Exemplo n.º 2
0
 def test_MAASAPIException_produces_http_response(self):
     error = factory.make_string()
     exception = MAASAPIBadRequest(error)
     response = exception.make_http_response()
     self.assertEqual(
         (http.client.BAD_REQUEST, error),
         (response.status_code,
          response.content.decode(settings.DEFAULT_CHARSET)))
Exemplo n.º 3
0
 def test_MAASAPIException_produces_http_response(self):
     error = factory.getRandomString()
     exception = MAASAPIBadRequest(error)
     response = exception.make_http_response()
     self.assertEqual((httplib.BAD_REQUEST, error),
                      (response.status_code, response.content))