]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Merge "Restrict Volume type deletion with volumes assoc"
authorJenkins <jenkins@review.openstack.org>
Mon, 9 Sep 2013 16:22:03 +0000 (16:22 +0000)
committerGerrit Code Review <review@openstack.org>
Mon, 9 Sep 2013 16:22:03 +0000 (16:22 +0000)
1  2 
cinder/tests/api/contrib/test_types_manage.py
cinder/tests/test_volume_types.py

index 1e3c09d2967cba38dcdd9299b4ac18412b27d6dc,0b359740e77619c6048e31078607796d6fabe444..596a7184e3567ad88c381db54c53e3e9d0927342
@@@ -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)
Simple merge