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