def test_list_extensions_xml(self):
    app = compute.APIRouter()
    request = webob.Request.blank('/fake/extensions')
    request.accept = 'application/xml'
    response = request.get_response(app)
    self.assertEqual(200, response.status_int)
    root = etree.XML(response.body)
    self.assertEqual(root.tag.split('extensions')[0], NS)
    exts = root.findall('{0}extension'.format(NS))
    self.assert_((len(exts) >= len(self.ext_list)))
    (fox_ext,) = [x for x in exts if (x.get('alias') == 'FOXNSOX')]
    self.assertEqual(fox_ext.get('name'), 'Fox In Socks')
    self.assertEqual(fox_ext.get('namespace'), 'http://www.fox.in.socks/api/ext/pie/v1.0')
    self.assertEqual(fox_ext.get('updated'), '2011-01-22T13:25:27-06:00')
    self.assertEqual(fox_ext.findtext('{0}description'.format(NS)), 'The Fox In Socks Extension')
    xmlutil.validate_schema(root, 'extensions')
def test_list_extensions_xml(self):
    app = compute.APIRouter()
    request = webob.Request.blank('/fake/extensions')
    request.accept = 'application/xml'
    response = request.get_response(app)
    self.assertEqual(200, response.status_int)
    root = etree.XML(response.body)
    self.assertEqual(root.tag.split('extensions')[0], NS)
    exts = root.findall('{0}extension'.format(NS))
    self.assert_((len(exts) >= len(self.ext_list)))
    (fox_ext,) = [x for x in exts if (x.get('alias') == 'FOXNSOX')]
    self.assertEqual(fox_ext.get('name'), 'Fox In Socks')
    self.assertEqual(fox_ext.get('namespace'), 'http://www.fox.in.socks/api/ext/pie/v1.0')
    self.assertEqual(fox_ext.get('updated'), '2011-01-22T13:25:27-06:00')
    self.assertEqual(fox_ext.findtext('{0}description'.format(NS)), 'The Fox In Socks Extension')
    xmlutil.validate_schema(root, 'extensions')