@@ -2279,11 +2279,41 @@ def test_lambda_concurrency_crud(self, snapshot, create_lambda_function, aws_cli
2279
2279
snapshot .match ("get_function_concurrency_updated" , updated_concurrency_result )
2280
2280
assert updated_concurrency_result ["ReservedConcurrentExecutions" ] == 0
2281
2281
2282
- function_concurrency_info = aws_client .lambda_ .get_function (FunctionName = func_name )[
2283
- "Concurrency"
2284
- ]
2285
- assert function_concurrency_info is not None
2286
- assert function_concurrency_info ["ReservedConcurrentExecutions" ] == 0
2282
+ aws_client .lambda_ .delete_function_concurrency (FunctionName = func_name )
2283
+
2284
+ deleted_concurrency_result = aws_client .lambda_ .get_function_concurrency (
2285
+ FunctionName = func_name
2286
+ )
2287
+ snapshot .match ("get_function_concurrency_deleted" , deleted_concurrency_result )
2288
+
2289
+ @markers .aws .validated
2290
+ def test_lambda_concurrency_update (self , snapshot , create_lambda_function , aws_client ):
2291
+ func_name = f"fn-concurrency-{ short_uid ()} "
2292
+ create_lambda_function (
2293
+ func_name = func_name ,
2294
+ handler_file = TEST_LAMBDA_PYTHON_ECHO ,
2295
+ runtime = Runtime .python3_12 ,
2296
+ )
2297
+ new_reserved_concurrency = 3
2298
+ reserved_concurrency_result = aws_client .lambda_ .put_function_concurrency (
2299
+ FunctionName = func_name , ReservedConcurrentExecutions = new_reserved_concurrency
2300
+ )
2301
+ snapshot .match ("put_function_concurrency" , reserved_concurrency_result )
2302 +
2303
+ updated_concurrency_result = aws_client .lambda_ .get_function_concurrency (
2304
+ FunctionName = func_name
2305
+ )
2306
+ snapshot .match ("get_function_concurrency_updated" , updated_concurrency_result )
2307
+ assert (
2308
+ updated_concurrency_result ["ReservedConcurrentExecutions" ] == new_reserved_concurrency
2309
+ )
2310
+
2311
+ 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
+ )
2287
2317
2288
2318
aws_client .lambda_ .delete_function_concurrency (FunctionName = func_name )
2289
2319
0 commit comments