summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wolf <throughnothing@gmail.com>2011-07-26 18:16:28 -0400
committerWilliam Wolf <throughnothing@gmail.com>2011-07-26 18:16:28 -0400
commit15068c4038d93db77278ea3306d992b424168c24 (patch)
tree35fcd3fc3dc090d4d29cc226e724302ed119cc0e
parent6dbd7583f4f1ca4be59e163c4c568423a91cd29e (diff)
added multi_choice test just to hit another resource
-rw-r--r--nova/tests/api/openstack/test_versions.py56
1 files changed, 54 insertions, 2 deletions
diff --git a/nova/tests/api/openstack/test_versions.py b/nova/tests/api/openstack/test_versions.py
index 587b085c3..d8d6cebe2 100644
--- a/nova/tests/api/openstack/test_versions.py
+++ b/nova/tests/api/openstack/test_versions.py
@@ -384,11 +384,63 @@ class VersionsTest(test.TestCase):
self.assertEqual(expected, actual)
- def test_multi_choice_servers_list(self):
+ def test_multi_choice_image(self):
+ req = webob.Request.blank('/images/1')
+ req.accept = "application/json"
+ res = req.get_response(fakes.wsgi_app())
+ self.assertEqual(res.status_int, 300)
+ self.assertEqual(res.content_type, "application/json")
+
+ expected = {
+ "choices": [
+ {
+ "id": "v1.1",
+ "status": "CURRENT",
+ "links": [
+ {
+ "href": "http://localhost:80/v1.1/images/1",
+ "rel": "self",
+ },
+ ],
+ "media-types": [
+ {
+ "base": "application/xml",
+ "type": "application/vnd.openstack.compute-v1.1+xml"
+ },
+ {
+ "base": "application/json",
+ "type": "application/vnd.openstack.compute-v1.1+json"
+ },
+ ],
+ },
+ {
+ "id": "v1.0",
+ "status": "DEPRECATED",
+ "links": [
+ {
+ "href": "http://localhost:80/v1.0/images/1",
+ "rel": "self",
+ },
+ ],
+ "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.assertDictMatch(expected, json.loads(res.body))
+
+ def test_multi_choice_server(self):
req = webob.Request.blank('/servers/2')
req.accept = "application/json"
res = req.get_response(fakes.wsgi_app())
- print res.body
self.assertEqual(res.status_int, 300)
self.assertEqual(res.content_type, "application/json")