10000 Labda: recorded snapshot for test, fixed suggestions · localstack/localstack@543f91b · GitHub
[go: up one dir, main page]

Skip to content

Commit 543f91b

Browse files
committed
Labda: recorded snapshot for test, fixed suggestions
1 parent b15da72 commit 543f91b

File tree

4 files changed

+60
-9
lines changed

4 files changed

+60
-9
lines changed

localstack-core/localstack/services/lambda_/provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,7 @@ def get_function(
15431543
)
15441544
concurrency = None
15451545
if fn.reserved_concurrent_executions:
1546-
concurrency = GetFunctionConcurrencyResponse(
1546+
concurrency = Concurrency(
15471547
ReservedConcurrentExecutions=fn.reserved_concurrent_executions
15481548
)
15491549

@@ -1552,8 +1552,8 @@ def get_function(
15521552
version, return_qualified_arn=bool(qualifier), alias_name=alias_name
15531553
),
15541554
Code=code_location, # TODO
1555-
**additional_fields,
15561555
Concurrency=concurrency,
1556+
**additional_fields,
15571557
)
15581558

15591559
def get_function_configuration(

tests/aws/services/lambda_/test_lambda.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,6 +2286,7 @@ def test_lambda_concurrency_crud(self, snapshot, create_lambda_function, aws_cli
22862286
)
22872287
snapshot.match("get_function_concurrency_deleted", deleted_concurrency_result)
22882288

2289+
@pytest.mark.skip_snapshot_verify(paths=["$..Configuration", "$..Code"])
22892290
@markers.aws.validated
22902291
def test_lambda_concurrency_update(self, snapshot, create_lambda_function, aws_client):
22912292
func_name = f"fn-concurrency-{short_uid()}"
@@ -2309,11 +2310,7 @@ def test_lambda_concurrency_update(self, snapshot, create_lambda_function, aws_c
23092310
)
23102311

23112312
function_concurrency_info = aws_client.lambda_.get_function(FunctionName=func_name)
2312-
assert function_concurrency_info["Concurrency"] is not None
2313-
assert (
2314-
function_concurrency_info["Concurrency"]["ReservedConcurrentExecutions"]
2315-
== new_reserved_concurrency
2316-
)
2313+
snapshot.match("get_function_concurrency_info", function_concurrency_info)
23172314

23182315
aws_client.lambda_.delete_function_concurrency(FunctionName=func_name)
23192316

tests/aws/services/lambda_/test_lambda.snapshot.json

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4503,7 +4503,7 @@
45034503
}
45044504
},
45054505
"tests/aws/services/lambda_/test_lambda.py::TestLambdaConcurrency::test_lambda_concurrency_update": {
4506-
"recorded-date": "22-05-2025, 13:11:43",
4506+
"recorded-date": "22-05-2025, 14:11:12",
45074507
"recorded-content": {
45084508
"put_function_concurrency": {
45094509
"ReservedConcurrentExecutions": 3,
@@ -4519,6 +4519,60 @@
45194519
"HTTPStatusCode": 200
45204520
}
45214521
},
4522+
"get_function_concurrency_info": {
4523+
"Code": {
4524+
"Location": "<location>",
4525+
"RepositoryType": "S3"
4526+
},
4527+
"Concurrency": {
4528+
"ReservedConcurrentExecutions": 3
4529+
},
4530+
"Configuration": {
4531+
"Architectures": [
4532+
"x86_64"
4533+
],
4534+
"CodeSha256": "code-sha256",
4535+
"CodeSize": "<code-size>",
4536+
"Description": "",
4537+
"Environment": {
4538+
"Variables": {}
4539+
},
4540+
"EphemeralStorage": {
4541+
"Size": 512
4542+
},
4543+
"FunctionArn": "arn:<partition>:lambda:<region>:111111111111:function:<function-name:1>",
4544+
"FunctionName": "<function-name:1>",
4545+
"Handler": "handler.handler",
4546+
"LastModified": "date",
4547+
"LastUpdateStatus": "Successful",
4548+
"LoggingConfig": {
4549+
"LogFormat": "Text",
4550+
"LogGroup": "/aws/lambda/<function-name:1>"
4551+
},
4552+
"MemorySize": 128,
4553+
"PackageType": "Zip",
4554+
"RevisionId": "<uuid:1>",
4555+
"Role": "arn:<partition>:iam::111111111111:role/<resource:1>",
4556+
"Runtime": "python3.12",
4557+
"RuntimeVersionConfig": {
4558+
"RuntimeVersionArn": "arn:<partition>:lambda:<region>::runtime:<resource:2>"
4559+
},
4560+
"SnapStart": {
4561+
"ApplyOn": "None",
4562+
"OptimizationStatus": "Off"
4563+
},
4564+
"State": "Active",
4565+
"Timeout": 30,
4566+
"TracingConfig": {
4567+
"Mode": "PassThrough"
4568+
},
4569+
"Version": "$LATEST"
4570+
},
4571+
"ResponseMetadata": {
4572+
"HTTPHeaders": {},
4573+
"HTTPStatusCode": 200
4574+
}
4575+
},
45224576
"get_function_concurrency_deleted": {
45234577
"ResponseMetadata": {
45244578
"HTTPHeaders": {},

tests/aws/services/lambda_/test_lambda.validation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"last_validated_date": "2025-05-22T08:04:13+00:00"
6767
},
6868
"tests/aws/services/lambda_/test_lambda.py::TestLambdaConcurrency::test_lambda_concurrency_update": {
69-
"last_validated_date": "2025-05-22T13:11:42+00:00"
69+
"last_validated_date": "2025-05-22T14:11:12+00:00"
7070
},
7171
"tests/aws/services/lambda_/test_lambda.py::TestLambdaConcurrency::test_lambda_provisioned_concurrency_moves_with_alias": {
7272
"last_validated_date": "2023-03-21T07:47:38+00:00"

0 commit comments

Comments
 (0)
0