File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
tests/integration/awslambda Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 18
18
19
19
def handler (event , context ):
20
20
# this lambda expects inputs from an SQS event source mapping
21
- if not event .get ("Records" ) :
22
- raise ValueError ("no records passed to event " )
21
+ if len ( event .get ("Records" , [])) != 1 :
22
+ raise ValueError ("the payload must consist of exactly one record " )
23
23
24
24
# it expects exactly one record where the message body is '{"destination": "<queue_url>"}' that mimics a
25
25
# DestinationConfig (which is not possible with SQS event source mappings).
@@ -49,7 +49,4 @@ def create_external_boto_client(service):
49
49
endpoint_url = (
50
50
f"http://{ os .environ ['LOCALSTACK_HOSTNAME' ]} :{ os .environ .get ('EDGE_PORT' , 4566 )} "
51
51
)
52
- region_name = (
53
- os .environ .get ("AWS_DEFAULT_REGION" ) or os .environ .get ("AWS_REGION" ) or "us-east-1"
54
- )
55
- return boto3 .client (service , endpoint_url = endpoint_url , region_name = region_name )
52
+ return boto3 .client (service , endpoint_url = endpoint_url )
Original file line number Diff line number Diff line change @@ -137,7 +137,6 @@ def test_failing_lambda_retries_after_visibility_timeout(
137
137
138
138
@pytest .mark .skip_snapshot_verify (
139
139
paths = [
140
- # FIXME: this is most of the event source mapping unfortunately
141
140
"$..ParallelizationFactor" ,
142
141
"$..LastProcessingResult" ,
143
142
"$..Topics" ,
@@ -158,9 +157,9 @@ def test_redrive_policy_with_failing_lambda(
158
157
snapshot ,
159
158
cleanups ,
160
159
):
161
- """This test verifies a that SQS moves a message that is passed to a failing lambda to a DLQ according to the
160
+ """This test verifies that SQS moves a message that is passed to a failing lambda to a DLQ according to the
162
161
redrive policy, and the lambda is invoked the correct number of times. The test retries twice and the event
163
- source mapping should then automatically move the message to the DQL , but not earlier (see
162
+ source mapping should then automatically move the message to the DLQ , but not earlier (see
164
163
https://github.com/localstack/localstack/issues/5283)"""
165
164
166
165
# create queue used in the lambda to send events to (to verify lambda was invoked)
You can’t perform that action at this time.
0 commit comments