summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorAlex Meade <alex.meade@rackspace.com>2011-07-25 15:36:28 -0400
committerAlex Meade <alex.meade@rackspace.com>2011-07-25 15:36:28 -0400
commit2e142a02014940ebb1e775c26b60c576ad1e2bb3 (patch)
tree066e5f26af5122a67262f42e577282bc05e62c4f /nova/tests
parentf3db3c1178cb918194b65a96eea01eeb289ad3e3 (diff)
Added check to make sure there is a server entity in the create server request
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/openstack/test_servers.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py
index 1c66c1aa6..fd2452dab 100644
--- a/nova/tests/api/openstack/test_servers.py
+++ b/nova/tests/api/openstack/test_servers.py
@@ -941,6 +941,18 @@ class ServersTest(test.TestCase):
res = req.get_response(fakes.wsgi_app())
self.assertEqual(res.status_int, 400)
+ def test_create_instance_no_server_entity(self):
+ self._setup_for_create_instance()
+
+ body = {}
+
+ req = webob.Request.blank('/v1.0/servers')
+ req.method = 'POST'
+ req.body = json.dumps(body)
+ req.headers["content-type"] = "application/json"
+ res = req.get_response(fakes.wsgi_app())
+ self.assertEqual(res.status_int, 422)
+
def test_create_instance_whitespace_name(self):
self._setup_for_create_instance()