def test_delete_security_group_rule_in_use(self): with mock.patch.object(registry, "notify") as mock_notify: mock_notify.side_effect = exceptions.CallbackFailure(Exception()) with testtools.ExpectedException( securitygroup.SecurityGroupRuleInUse): self.mixin.delete_security_group_rule(self.ctx, mock.ANY)
def test_inner_exceptions(self): key_err = KeyError() n_key_err = ex.NotificationError('cb1', key_err) err = ex.CallbackFailure([key_err, n_key_err]) self.assertEqual([key_err, n_key_err.error], err.inner_exceptions)