"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "masakari/tests/unit/api/openstack/test_wsgi.py" between
masakari-10.0.2.tar.gz and masakari-10.0.3.tar.gz

About: OpenStack Masakari provides "Instances High Availability Service" for OpenStack clouds by automatically recovering failed Instances (currently for KVM-based Virtual Machine(VM)s).
The "Victoria" series (maintained release).

test_wsgi.py  (masakari-10.0.2):test_wsgi.py  (masakari-10.0.3)
skipping to change at line 250 skipping to change at line 250
req.content_type = 'application/json' req.content_type = 'application/json'
response = req.get_response(app) response = req.get_response(app)
self.assertEqual(b'success', response.body) self.assertEqual(b'success', response.body)
self.assertEqual(response.status_int, http.OK) self.assertEqual(response.status_int, http.OK)
def test_resource_call_with_method_post(self): def test_resource_call_with_method_post(self):
class Controller(object): class Controller(object):
@extensions.expected_errors(http.BAD_REQUEST) @extensions.expected_errors(http.BAD_REQUEST)
def create(self, req, body): def create(self, req, body):
if expected_body != body: if expected_body != body:
msg = "The request body invalid" raise exception.ConvertedException(
raise webob.exc.HTTPBadRequest(explanation=msg) code=http.BAD_REQUEST,
explanation="The request body invalid")
return "success" return "success"
# verify the method: POST # verify the method: POST
app = fakes.TestRouter(Controller()) app = fakes.TestRouter(Controller())
req = webob.Request.blank('/tests', method="POST", req = webob.Request.blank('/tests', method="POST",
content_type='application/json') content_type='application/json')
req.body = b'{"body": {"key": "value"}}' req.body = b'{"body": {"key": "value"}}'
expected_body = {'body': { expected_body = {'body': {
"key": "value" "key": "value"
} }
} }
 End of changes. 1 change blocks. 
2 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)