summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorWilliam Wolf <throughnothing@gmail.com>2011-07-25 14:10:08 -0400
committerWilliam Wolf <throughnothing@gmail.com>2011-07-25 14:10:08 -0400
commit99bc14f16bce9f125715fbe436b7fc0969b62420 (patch)
tree13f387f6978d57c09e9fd9bfbb96f24ab2e19dc2 /nova/tests
parent0e2726f452fe6991797728bca1e514943725e7a2 (diff)
added 1.0 detail test, added VersionRequestDeserializer to support Versions actions properly, started 300/multiple choice work
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/openstack/test_versions.py51
1 files changed, 50 insertions, 1 deletions
diff --git a/nova/tests/api/openstack/test_versions.py b/nova/tests/api/openstack/test_versions.py
index aaa1f4976..b2896a780 100644
--- a/nova/tests/api/openstack/test_versions.py
+++ b/nova/tests/api/openstack/test_versions.py
@@ -68,6 +68,55 @@ class VersionsTest(test.TestCase):
]
self.assertEqual(versions, expected)
+ def test_get_version_1_0_detail(self):
+ req = webob.Request.blank('/v1.0/')
+ req.accept = "application/json"
+ res = req.get_response(fakes.wsgi_app())
+ print res.body
+ self.assertEqual(res.status_int, 200)
+ self.assertEqual(res.content_type, "application/json")
+ versions = json.loads(res.body)["versions"]
+ expected = [
+ {
+ "version" : {
+ "id" : "v1.0",
+ "status" : "CURRENT",
+ "updated" : "2011-01-21T11:33:21-06:00",
+ "links": [
+ {
+ "rel" : "self",
+ "href" : "http://servers.api.openstack.org/v1.0/"
+ },
+ {
+ "rel" : "describedby",
+ "type" : "application/pdf",
+ "href" : "http://docs.rackspacecloud.com/"
+ "servers/api/v1.0/cs-devguide-20110125.pdf"
+ },
+ {
+ "rel" : "describedby",
+ "type" : "application/vnd.sun.wadl+xml",
+ "href" : "http://docs.rackspacecloud.com/"
+ "servers/api/v1.0/application.wadl"
+ }
+ ],
+ "media-types": [
+ {
+ "base" : "application/xml",
+ "type" : "application/"
+ "vnd.openstack.compute-v1.0+xml"
+ },
+ {
+ "base" : "application/json",
+ "type" : "application/"
+ "vnd.openstack.compute-v1.0+json"
+ }
+ ]
+ }
+ }
+ ]
+ self.assertEqual(versions, expected)
+
def test_get_version_1_1_detail(self):
req = webob.Request.blank('/v1.1/')
req.accept = "application/json"
@@ -85,7 +134,7 @@ class VersionsTest(test.TestCase):
"links": [
{
"rel" : "self",
- "href" : "http://servers.api.openstack.org/v1.0/"
+ "href" : "http://servers.api.openstack.org/v1.1/"
},
{
"rel" : "describedby",