aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.6k stars 1.01k forks source link

Add ability to set metadata fields in test events #1639

Open jmteachw opened 3 years ago

jmteachw commented 3 years ago

Currently with test methods like generate_sqs_event, generate_sns_event, etc. you can only set the message/message body. It would be helpful to have the ability to set some of the metadata fields in these events (e.g. messageAttributes in SQS or MessageAttrirbutes in SNS), as some of our lambda jobs need this information to function properly. Currently I don't know that there's a way around this, other than changing the actual lambda handler code to add an exception for tests, which isn't ideal.

jamesls commented 3 years ago

I agree, this would be helpful to have. Should be a straightforward addition.