mirror of
https://github.com/Sea-Haven-Industries/proposal-system.git
synced 2026-10-02 09:33:13 +00:00
22 lines
654 B
Python
22 lines
654 B
Python
|
|
"""Test helpers for Lambda tests."""
|
||
|
|
|
||
|
|
import json
|
||
|
|
|
||
|
|
|
||
|
|
def make_sqs_event(*bodies: dict) -> dict:
|
||
|
|
"""Build a minimal SQS event with the given record bodies."""
|
||
|
|
records = []
|
||
|
|
for i, body in enumerate(bodies):
|
||
|
|
records.append({
|
||
|
|
"messageId": f"msg-{i}",
|
||
|
|
"body": json.dumps(body),
|
||
|
|
"receiptHandle": f"handle-{i}",
|
||
|
|
"attributes": {},
|
||
|
|
"messageAttributes": {},
|
||
|
|
"md5OfBody": "",
|
||
|
|
"eventSource": "aws:sqs",
|
||
|
|
"eventSourceARN": "arn:aws:sqs:us-east-1:123456789012:test-queue",
|
||
|
|
"awsRegion": "us-east-1",
|
||
|
|
})
|
||
|
|
return {"Records": records}
|