def test_does_authorize_unsupported_authorizer(self, demo_app_auth,
lambda_context_args,
create_event):
authorizer = LocalGatewayAuthorizer(demo_app_auth)
path = '/iam'
event = create_event(path, 'GET', {})
context = LambdaContext(*lambda_context_args)
with pytest.warns(None) as recorded_warnings:
new_event, new_context = authorizer.authorize(path, event, context)
assert event == new_event
assert context == new_context
assert len(recorded_warnings) == 1
warning = recorded_warnings[0]
assert issubclass(warning.category, UserWarning)
assert ('IAMAuthorizer is not a supported in local '
'mode. All requests made against a route will be authorized'
' to allow local testing.') in str(warning.message)
评论列表
文章目录