summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorNirmal Ranganathan <nirmal.ranganathan@rackspace.com>2011-05-16 20:39:18 +0000
committerTarmac <>2011-05-16 20:39:18 +0000
commit8d5d0cfeadb42dec55bd94664a28ddd63b7d51d6 (patch)
treeb192bfac8d963af2d856d63d7b0cd83eb331d8c9 /nova/tests
parent799f09b01eca9f668b4c139e2a3fa419ed00c142 (diff)
parentd031368b9bba8c9fca066bc6bbce511581806fa5 (diff)
Added missing flavorRef and imageRef checks in the os api xml deserialization code along with tests
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/openstack/test_servers.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py
index eebc7f754..e8182b6a9 100644
--- a/nova/tests/api/openstack/test_servers.py
+++ b/nova/tests/api/openstack/test_servers.py
@@ -1654,6 +1654,19 @@ b25zLiINCg0KLVJpY2hhcmQgQmFjaA==""",
request = self.deserializer.deserialize(serial_request)
self.assertEqual(request, expected)
+ def test_request_xmlser_with_flavor_image_ref(self):
+ serial_request = """
+ <server xmlns="http://docs.openstack.org/compute/api/v1.1"
+ name="new-server-test"
+ imageRef="http://localhost:8774/v1.1/images/1"
+ flavorRef="http://localhost:8774/v1.1/flavors/1">
+ </server>"""
+ request = self.deserializer.deserialize(serial_request)
+ self.assertEquals(request["server"]["flavorRef"],
+ "http://localhost:8774/v1.1/flavors/1")
+ self.assertEquals(request["server"]["imageRef"],
+ "http://localhost:8774/v1.1/images/1")
+
class TestServerInstanceCreation(test.TestCase):