Exemplo n.º 1
0
    def test_share_types_delete_in_use(self):

        req = fakes.HTTPRequest.blank('/v2/fake/types/1')
        self.assertEqual(0, len(fake_notifier.NOTIFICATIONS))
        side_effect = exception.ShareTypeInUse(share_type_id='fake_id')
        self.mock_object(share_types, 'destroy',
                         mock.Mock(side_effect=side_effect))

        self.assertRaises(webob.exc.HTTPBadRequest, self.controller._delete,
                          req, 1)
Exemplo n.º 2
0
def return_share_types_with_volumes_destroy(context, id):
    if id == "1":
        raise exception.ShareTypeInUse(share_type_id=id)
    pass