def test_show_consistencygroup_xml_content_type(self): consistencygroup_id = self._create_consistencygroup() req = webob.Request.blank("/v2/fake/consistencygroups/%s" % consistencygroup_id) req.method = "GET" req.headers["Content-Type"] = "application/xml" req.headers["Accept"] = "application/xml" res = req.get_response(fakes.wsgi_app()) self.assertEqual(200, res.status_int) dom = minidom.parseString(res.body) consistencygroup = dom.getElementsByTagName("consistencygroup") name = consistencygroup.item(0).getAttribute("name") self.assertEqual("test_consistencygroup", name.strip()) db.consistencygroup_destroy(context.get_admin_context(), consistencygroup_id)
def test_show_consistencygroup_xml_content_type(self): consistencygroup_id = self._create_consistencygroup() req = webob.Request.blank('/v2/fake/consistencygroups/%s' % consistencygroup_id) req.method = 'GET' req.headers['Content-Type'] = 'application/xml' req.headers['Accept'] = 'application/xml' res = req.get_response(fakes.wsgi_app()) self.assertEqual(200, res.status_int) dom = minidom.parseString(res.body) consistencygroup = dom.getElementsByTagName('consistencygroup') name = consistencygroup.item(0).getAttribute('name') self.assertEqual("test_consistencygroup", name.strip()) db.consistencygroup_destroy(context.get_admin_context(), consistencygroup_id)
def test_show_consistencygroup_xml_content_type(self): consistencygroup_id = self._create_consistencygroup() req = webob.Request.blank('/v2/fake/consistencygroups/%s' % consistencygroup_id) req.method = 'GET' req.headers['Content-Type'] = 'application/xml' req.headers['Accept'] = 'application/xml' res = req.get_response(fakes.wsgi_app()) self.assertEqual(res.status_int, 200) dom = minidom.parseString(res.body) consistencygroup = dom.getElementsByTagName('consistencygroup') name = consistencygroup.item(0).getAttribute('name') self.assertEqual(name.strip(), "test_consistencygroup") db.consistencygroup_destroy( context.get_admin_context(), consistencygroup_id)