-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest2.py
More file actions
26 lines (22 loc) · 902 Bytes
/
test2.py
File metadata and controls
26 lines (22 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import json
from lambda_function import lambda_handler
# Create a dummy context class for testing
class DummyContext:
def __init__(self):
self.function_name = "test_lambda"
self.memory_limit_in_mb = 128
self.invoked_function_arn = "arn:aws:lambda:region:account-id:function:test_lambda"
self.aws_request_id = "test_request_id"
if __name__ == '__main__':
# Define a test event with required parameters.
test_event = {
"job_id": "762e7ae1-a7ff-46cf-934e-c5f8f9c1b810",
"monitored_shortcode": "DExfnDVxaHe",
"watched_shortcodes": ["DGAtueNiuUe", "DG1KbHkqD5k", "DF9t1vuoxgm"],
"platform": "instagram",
"extension": "png"
}
# Call lambda_handler with the test event and dummy context
result = lambda_handler(test_event, DummyContext())
# Pretty-print the result
print(json.dumps(result, indent=4))