self.m.StubOutWithMock(instance.Instance, 'handle_create')
self.m.StubOutWithMock(instance.Instance, 'check_create_complete')
- exc = exception.ResourceFailure(Exception())
- instance.Instance.handle_create().AndRaise(exc)
+ instance.Instance.handle_create().AndRaise(Exception)
self.m.ReplayAll()
rsrc = asc.AutoScalingGroup('WebServerGroup',
# Scale up one 1 instance with resource failure
self.m.StubOutWithMock(instance.Instance, 'handle_create')
- exc = exception.ResourceFailure(Exception())
- instance.Instance.handle_create().AndRaise(exc)
+ instance.Instance.handle_create().AndRaise(Exception)
self.m.StubOutWithMock(instance.Instance, 'destroy')
instance.Instance.destroy()
self._stub_lb_reload(1, unset=False, nochange=True)
def test_suspend_fail(self):
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_suspend')
- exc = exception.ResourceFailure(Exception('foo'))
+ exc = Exception('foo')
generic_rsrc.GenericResource.handle_suspend().AndRaise(exc)
self.m.ReplayAll()
def test_resume_fail(self):
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_resume')
- exc = exception.ResourceFailure(Exception('foo'))
- generic_rsrc.GenericResource.handle_resume().AndRaise(exc)
+ generic_rsrc.GenericResource.handle_resume().AndRaise(Exception('foo'))
self.m.ReplayAll()
self.stack = parser.Stack(self.ctx, 'resume_test_fail',
# key/property in update_allowed_keys/update_allowed_properties
# make the update fail deleting the existing resource
- self.m.StubOutWithMock(resource.Resource, 'destroy')
- exc = exception.ResourceFailure(Exception())
- resource.Resource.destroy().AndRaise(exc)
+ self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_delete')
+ generic_rsrc.GenericResource.handle_delete().AndRaise(Exception)
self.m.ReplayAll()
self.stack.update(updated_stack)
template.Template(tmpl2))
# patch in a dummy delete making the destroy fail
- self.m.StubOutWithMock(resource.Resource, 'delete')
- exc = exception.ResourceFailure(Exception())
- resource.Resource.delete().AndRaise(exc)
+ self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_delete')
+ generic_rsrc.GenericResource.handle_delete().AndRaise(Exception)
self.m.ReplayAll()
self.stack.update(updated_stack)