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)