From 6c25483c08965204e8a4199ec600098fe09ad87c Mon Sep 17 00:00:00 2001 From: Tushar Patil Date: Wed, 27 Jul 2011 15:02:00 -0700 Subject: added unit testcase to increase code coverage --- nova/tests/api/openstack/contrib/test_createserverext.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nova/tests/api/openstack/contrib/test_createserverext.py b/nova/tests/api/openstack/contrib/test_createserverext.py index 4866f29fe..4db15d2f1 100644 --- a/nova/tests/api/openstack/contrib/test_createserverext.py +++ b/nova/tests/api/openstack/contrib/test_createserverext.py @@ -222,6 +222,16 @@ class CreateserverextTest(test.TestCase): self._run_create_instance_with_mock_compute_api(request) self.assertEquals(response.status_int, 422) + def test_create_instance_with_no_server_name(self): + server = {} + server['imageRef'] = 1 + server['flavorRef'] = 1 + body_dict = {'server': server} + request = self._get_create_request_json(body_dict) + compute_api, response = \ + self._run_create_instance_with_mock_compute_api(request) + self.assertEquals(response.status_int, 400) + def test_create_instance_with_no_personality(self): request, response, injected_files = \ self._create_instance_with_personality_json(personality=None) -- cgit