dschep / lambda-decorators

🐍λ✨ - A collection of useful decorators for making AWS Lambda handlers

Home Page:http://lambda-decorators.rtfd.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running tests raises exceptions without fake context

evbots opened this issue · comments

Running a handler in a test environment raises exceptions. Just FYI that mocking aws context is required. Maybe that is obvious? Feel free to close if there is no other way around this.

@wraps(handler)
    def wrapper(event, context):
>       if context.aws_request_id in seen_request_ids:
E       AttributeError: 'dict' object has no attribute 'aws_request_id'

This is obvious to me now as required. maybe at some point a test helpers library could be included in this package for things like this.