From: Jenkins Date: Mon, 9 Sep 2013 16:22:03 +0000 (+0000) Subject: Merge "Restrict Volume type deletion with volumes assoc" X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=83cb5b1cfc62c6b5567d738d9cdf12435d20745f;p=openstack-build%2Fcinder-build.git Merge "Restrict Volume type deletion with volumes assoc" --- 83cb5b1cfc62c6b5567d738d9cdf12435d20745f diff --cc cinder/tests/api/contrib/test_types_manage.py index 1e3c09d29,0b359740e..596a7184e --- a/cinder/tests/api/contrib/test_types_manage.py +++ b/cinder/tests/api/contrib/test_types_manage.py @@@ -91,8 -97,18 +97,18 @@@ class VolumeTypesManageApiTest(test.Tes req = fakes.HTTPRequest.blank('/v2/fake/types/777') self.assertRaises(webob.exc.HTTPNotFound, self.controller._delete, req, '777') - self.assertEquals(len(test_notifier.NOTIFICATIONS), 1) + self.assertEqual(len(test_notifier.NOTIFICATIONS), 1) + def test_volume_types_with_volumes_destroy(self): + self.stubs.Set(volume_types, 'get_volume_type', + return_volume_types_get_volume_type) + self.stubs.Set(volume_types, 'destroy', + return_volume_types_with_volumes_destroy) + req = fakes.HTTPRequest.blank('/v2/fake/types/1') + self.assertEquals(len(test_notifier.NOTIFICATIONS), 0) + self.controller._delete(req, 1) + self.assertEquals(len(test_notifier.NOTIFICATIONS), 1) + def test_create(self): self.stubs.Set(volume_types, 'create', return_volume_types_create)