Example #1
0
 def w(world):
     data = {}
     try:
         data = f(world)
     except Exception:
         logger.warning(f'Failed to effect {name} change.', exc_info=True)
     return assoc_in(world, ['effects', name], data)
def test_handler_only_connected(context, cfn_event):
    context.mock_ct.describe_trails.return_value = {'trailList': []}
    context.mock_cur.describe_report_definitions.return_value = {
        'ReportDefinitions': []
    }
    context.mock_s3.list_buckets.return_value = {'Buckets': []}
    ret = app.handler(cfn_event, None)
    assert ret is None
    assert context.mock_cfnresponse_send.call_count == 1
    ((_, _, status, output, _),
     kwargs) = context.mock_cfnresponse_send.call_args
    assert status == cfnresponse.SUCCESS
    assert output == assoc_in(app.DEFAULT_OUTPUT, ['IsResourceOwnerAccount'],
                              True)