File tree 1 file changed +13
-0
lines changed
tests/integrations/aws_lambda
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
import base64
2
2
import json
3
3
import os
4
+ import re
4
5
import shutil
5
6
import subprocess
6
7
import sys
@@ -146,6 +147,18 @@ def test_handler(event, context):
146
147
147
148
assert event ["extra" ]["lambda" ]["function_name" ].startswith ("test_function_" )
148
149
150
+ logs_url = event ["extra" ]["cloudwatch logs" ]["url" ]
151
+ assert logs_url .startswith ("https://console.aws.amazon.com/cloudwatch/home?region=" )
152
+ assert not re .search ("(=;|=$)" , logs_url )
153
+ assert event ["extra" ]["cloudwatch logs" ]["log_group" ].startswith (
154
+ "/aws/lambda/test_function_"
155
+ )
156
+
157
+ log_stream_re = "^[0-9]{4}/[0-9]{2}/[0-9]{2}/\\ [[^\\ ]]+][a-f0-9]+$"
158
+ log_stream = event ["extra" ]["cloudwatch logs" ]["log_stream" ]
159
+
160
+ assert re .match (log_stream_re , log_stream )
161
+
149
162
150
163
def test_initialization_order (run_lambda_function ):
151
164
"""Zappa lazily imports our code, so by the time we monkeypatch the handler
You can’t perform that action at this time.
0 commit comments