Merge "Fix WADL/PDF docs referenced in describedby links"

This commit is contained in:
Jenkins
2012-02-14 18:14:09 +00:00
committed by Gerrit Code Review
3 changed files with 36 additions and 28 deletions

View File

@@ -52,6 +52,7 @@ Duncan McGreggor <duncan@dreamhost.com>
Ed Leafe <ed@leafe.com>
Edouard Thuleau <edouard1.thuleau@orange.com>
Eldar Nugaev <reldan@oscloud.ru>
Eoghan Glynn <eglynn@redhat.com>
Eric Day <eday@oddments.org>
Eric Windisch <eric@cloudscaling.com>
Ewan Mellor <ewan.mellor@citrix.com>

View File

@@ -24,6 +24,16 @@ from nova.api.openstack import wsgi
from nova.api.openstack import xmlutil
LINKS = {
'v2.0': {
'pdf': 'http://docs.openstack.org/'
'api/openstack-compute/1.1/os-compute-devguide-1.1.pdf',
'wadl': 'http://docs.openstack.org/'
'api/openstack-compute/1.1/wadl/os-compute-1.1.wadl',
},
}
VERSIONS = {
"v2.0": {
"id": "v2.0",
@@ -33,14 +43,12 @@ VERSIONS = {
{
"rel": "describedby",
"type": "application/pdf",
"href": "http://docs.rackspacecloud.com/"
"servers/api/v1.1/cs-devguide-20110125.pdf",
"href": LINKS['v2.0']['pdf'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": "http://docs.rackspacecloud.com/"
"servers/api/v1.1/application.wadl",
"href": LINKS['v2.0']['wadl'],
},
],
"media-types": [

View File

@@ -37,6 +37,17 @@ NS = {
'ns': 'http://docs.openstack.org/compute/api/v1.1'
}
LINKS = {
'v2.0': {
'pdf': 'http://docs.openstack.org/'
'api/openstack-compute/1.1/os-compute-devguide-1.1.pdf',
'wadl': 'http://docs.openstack.org/'
'api/openstack-compute/1.1/wadl/os-compute-1.1.wadl',
},
}
VERSIONS = {
"v2.0": {
"id": "v2.0",
@@ -46,14 +57,12 @@ VERSIONS = {
{
"rel": "describedby",
"type": "application/pdf",
"href": "http://docs.rackspacecloud.com/"
"servers/api/v1.1/cs-devguide-20110125.pdf",
"href": LINKS['v2.0']['pdf'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": "http://docs.rackspacecloud.com/"
"servers/api/v1.1/application.wadl",
"href": LINKS['v2.0']['wadl'],
},
],
"media-types": [
@@ -133,14 +142,12 @@ class VersionsTest(test.TestCase):
{
"rel": "describedby",
"type": "application/pdf",
"href": "http://docs.rackspacecloud.com/"
"servers/api/v1.1/cs-devguide-20110125.pdf",
"href": LINKS['v2.0']['pdf'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": "http://docs.rackspacecloud.com/"
"servers/api/v1.1/application.wadl",
"href": LINKS['v2.0']['wadl'],
},
],
"media-types": [
@@ -179,14 +186,12 @@ class VersionsTest(test.TestCase):
{
"rel": "describedby",
"type": "application/pdf",
"href": "http://docs.rackspacecloud.com/"
"servers/api/v1.1/cs-devguide-20110125.pdf",
"href": LINKS['v2.0']['pdf'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": "http://docs.rackspacecloud.com/"
"servers/api/v1.1/application.wadl",
"href": LINKS['v2.0']['wadl'],
},
],
"media-types": [
@@ -283,13 +288,11 @@ class VersionsTest(test.TestCase):
self.assertEqual(entry.links[0]['href'], 'http://localhost/v2/')
self.assertEqual(entry.links[0]['rel'], 'self')
self.assertEqual(entry.links[1], {
'href': 'http://docs.rackspacecloud.com/servers/api/v1.1/'\
'cs-devguide-20110125.pdf',
'href': LINKS['v2.0']['pdf'],
'type': 'application/pdf',
'rel': 'describedby'})
self.assertEqual(entry.links[2], {
'href': 'http://docs.rackspacecloud.com/servers/api/v1.1/'\
'application.wadl',
'href': LINKS['v2.0']['wadl'],
'type': 'application/vnd.sun.wadl+xml',
'rel': 'describedby'})
@@ -606,14 +609,12 @@ class VersionsSerializerTests(test.TestCase):
{
"rel": "describedby",
"type": "application/pdf",
"href": "http://docs.rackspacecloud.com/"
"servers/api/v1.1/cs-devguide-20110125.pdf",
"href": LINKS['v2.0']['pdf'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": "http://docs.rackspacecloud.com/"
"servers/api/v1.1/application.wadl",
"href": LINKS['v2.0']['wadl'],
},
],
"media-types": [
@@ -658,11 +659,9 @@ class VersionsSerializerTests(test.TestCase):
self.assertEqual(entry.links[1], {
'rel': 'describedby',
'type': 'application/pdf',
'href': 'http://docs.rackspacecloud.com/'
'servers/api/v1.1/cs-devguide-20110125.pdf'})
'href': LINKS['v2.0']['pdf']})
self.assertEqual(entry.links[2], {
'rel': 'describedby',
'type': 'application/vnd.sun.wadl+xml',
'href': 'http://docs.rackspacecloud.com/'
'servers/api/v1.1/application.wadl',
'href': LINKS['v2.0']['wadl'],
})