Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"cognitoAuthenticationType": None,
"cognitoAuthenticationProvider": None,
"userArn": "arn:aws:iam::123214323",
"userAgent": "Apache-HttpClient/4.5.x (Java/1.8.0_102)",
"user": "asdfsadsfads",
},
"resourcePath": "/test",
"httpMethod": "POST",
"apiId": "90o718c6bk",
},
"body": None,
"isBase64Encoded": False,
}
self.context = {"foo": "bar"}
self.lambda_handler = create_lambda_handler()
self.lambda_handler_application_load_balancer = create_lambda_handler(
application_load_balancer=True
)
def test_exception_in_handler_should_be_reraised(self):
json_body = {}
self.event["body"] = json.dumps(json_body)
self.event["httpMethod"] = "GET"
self.event["resource"] = "/foo/bar"
def divide_by_zero(_):
return 1 / 0
self.lambda_handler = create_lambda_handler(error_handler=None)
self.lambda_handler.handle("get", path="/foo/bar")(divide_by_zero)
with self.assertRaises(ZeroDivisionError):
self.lambda_handler(self.event, self.context)
"accessKey": "asdfasdfasdfasfd",
"cognitoAuthenticationType": None,
"cognitoAuthenticationProvider": None,
"userArn": "arn:aws:iam::123214323",
"userAgent": "Apache-HttpClient/4.5.x (Java/1.8.0_102)",
"user": "asdfsadsfads",
},
"resourcePath": "/test",
"httpMethod": "POST",
"apiId": "90o718c6bk",
},
"body": None,
"isBase64Encoded": False,
}
self.context = {"foo": "bar"}
self.lambda_handler = create_lambda_handler()
self.lambda_handler_application_load_balancer = create_lambda_handler(
application_load_balancer=True
)