diff options
| author | Boris Pavlovic <boris@pavlovic.me> | 2013-04-23 23:54:24 +0400 |
|---|---|---|
| committer | Boris Pavlovic <boris@pavlovic.me> | 2013-04-24 13:26:19 +0400 |
| commit | a8b4902ff4c8640d454ba53e3c21051aa5ea05ce (patch) | |
| tree | 26f85d9430e48f956e3cf3b353a7f547adc7d918 | |
| parent | 5a604b5924dae368da4b6561550bb430e3239ca3 (diff) | |
Add missing test for db.instance_type_destroy method
This test checks that if there is no such instance_type
then is raised exception.InstanceTypeNotFound
blueprint db-api-tests
Change-Id: I0a0db7aaefe6ac781c520e3b90958800db8fd52b
| -rw-r--r-- | nova/tests/test_db_api.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/tests/test_db_api.py b/nova/tests/test_db_api.py index 0af6ed143..ad793f13f 100644 --- a/nova/tests/test_db_api.py +++ b/nova/tests/test_db_api.py @@ -2083,6 +2083,10 @@ class InstanceTypeTestCase(BaseInstanceTypeTestCase): r_inst_type2 = db.instance_type_get(self.ctxt, inst_type2['id']) self._assertEqualObjects(inst_type2, r_inst_type2, 'extra_specs') + def test_instance_type_destroy_not_found(self): + self.assertRaises(exception.InstanceTypeNotFound, + db.instance_type_destroy, self.ctxt, 'nonexists') + def test_instance_type_create_duplicate_name(self): self._create_inst_type({}) self.assertRaises(exception.InstanceTypeExists, |
