Best Python code snippet using localstack_python
__init__.pyi
Source:__init__.pyi
1"""2Main interface for lambda service.3Usage::4 ```python5 import boto36 from mypy_boto3_lambda import (7 Client,8 FunctionActiveV2Waiter,9 FunctionActiveWaiter,10 FunctionExistsWaiter,11 FunctionUpdatedV2Waiter,12 FunctionUpdatedWaiter,13 LambdaClient,14 ListAliasesPaginator,15 ListCodeSigningConfigsPaginator,16 ListEventSourceMappingsPaginator,17 ListFunctionEventInvokeConfigsPaginator,18 ListFunctionUrlConfigsPaginator,19 ListFunctionsByCodeSigningConfigPaginator,20 ListFunctionsPaginator,21 ListLayerVersionsPaginator,22 ListLayersPaginator,23 ListProvisionedConcurrencyConfigsPaginator,24 ListVersionsByFunctionPaginator,25 )26 session = boto3.Session()27 client: LambdaClient = boto3.client("lambda")28 session_client: LambdaClient = session.client("lambda")29 function_active_waiter: FunctionActiveWaiter = client.get_waiter("function_active")30 function_active_v2_waiter: FunctionActiveV2Waiter = client.get_waiter("function_active_v2")31 function_exists_waiter: FunctionExistsWaiter = client.get_waiter("function_exists")32 function_updated_waiter: FunctionUpdatedWaiter = client.get_waiter("function_updated")33 function_updated_v2_waiter: FunctionUpdatedV2Waiter = client.get_waiter("function_updated_v2")34 list_aliases_paginator: ListAliasesPaginator = client.get_paginator("list_aliases")35 list_code_signing_configs_paginator: ListCodeSigningConfigsPaginator = client.get_paginator("list_code_signing_configs")36 list_event_source_mappings_paginator: ListEventSourceMappingsPaginator = client.get_paginator("list_event_source_mappings")37 list_function_event_invoke_configs_paginator: ListFunctionEventInvokeConfigsPaginator = client.get_paginator("list_function_event_invoke_configs")38 list_function_url_configs_paginator: ListFunctionUrlConfigsPaginator = client.get_paginator("list_function_url_configs")39 list_functions_paginator: ListFunctionsPaginator = client.get_paginator("list_functions")40 list_functions_by_code_signing_config_paginator: ListFunctionsByCodeSigningConfigPaginator = client.get_paginator("list_functions_by_code_signing_config")41 list_layer_versions_paginator: ListLayerVersionsPaginator = client.get_paginator("list_layer_versions")42 list_layers_paginator: ListLayersPaginator = client.get_paginator("list_layers")43 list_provisioned_concurrency_configs_paginator: ListProvisionedConcurrencyConfigsPaginator = client.get_paginator("list_provisioned_concurrency_configs")44 list_versions_by_function_paginator: ListVersionsByFunctionPaginator = client.get_paginator("list_versions_by_function")45 ```46"""47from .client import LambdaClient48from .paginator import (49 ListAliasesPaginator,50 ListCodeSigningConfigsPaginator,51 ListEventSourceMappingsPaginator,52 ListFunctionEventInvokeConfigsPaginator,53 ListFunctionsByCodeSigningConfigPaginator,54 ListFunctionsPaginator,55 ListFunctionUrlConfigsPaginator,56 ListLayersPaginator,57 ListLayerVersionsPaginator,58 ListProvisionedConcurrencyConfigsPaginator,59 ListVersionsByFunctionPaginator,60)61from .waiter import (62 FunctionActiveV2Waiter,63 FunctionActiveWaiter,64 FunctionExistsWaiter,65 FunctionUpdatedV2Waiter,66 FunctionUpdatedWaiter,67)68Client = LambdaClient69__all__ = (70 "Client",71 "FunctionActiveV2Waiter",72 "FunctionActiveWaiter",73 "FunctionExistsWaiter",74 "FunctionUpdatedV2Waiter",75 "FunctionUpdatedWaiter",76 "LambdaClient",77 "ListAliasesPaginator",78 "ListCodeSigningConfigsPaginator",79 "ListEventSourceMappingsPaginator",80 "ListFunctionEventInvokeConfigsPaginator",81 "ListFunctionUrlConfigsPaginator",82 "ListFunctionsByCodeSigningConfigPaginator",83 "ListFunctionsPaginator",84 "ListLayerVersionsPaginator",85 "ListLayersPaginator",86 "ListProvisionedConcurrencyConfigsPaginator",87 "ListVersionsByFunctionPaginator",...
lambda_fixtures.py
Source:lambda_fixtures.py
1import boto32import pytest3from moto import mock_lambda4@pytest.fixture5def gen_lambda_client(aws_setup):6 with mock_lambda():7 yield boto3.client("lambda")8# ============================9# WAITER10# ============================11@pytest.fixture12def gen_function_exists_waiter(gen_lambda_client):13 return gen_lambda_client.get_waiter("function_exists")14@pytest.fixture15def gen_function_active_waiter(gen_lambda_client):16 return gen_lambda_client.get_waiter("function_active")17@pytest.fixture18def gen_function_updated_waiter(gen_lambda_client):19 return gen_lambda_client.get_waiter("function_updated")20# ============================21# PAGINATOR22# ============================23@pytest.fixture24def gen_list_event_source_mappings_paginator(gen_lambda_client):25 return gen_lambda_client.get_paginator("list_event_source_mappings")26@pytest.fixture27def gen_list_functions_paginator(gen_lambda_client):28 return gen_lambda_client.get_paginator("list_functions")29@pytest.fixture30def gen_list_aliases_paginator(gen_lambda_client):31 return gen_lambda_client.get_paginator("list_aliases")32@pytest.fixture33def gen_list_layer_versions_paginator(gen_lambda_client):34 return gen_lambda_client.get_paginator("list_layer_versions")35@pytest.fixture36def gen_list_layers_paginator(gen_lambda_client):37 return gen_lambda_client.get_paginator("list_layers")38@pytest.fixture39def gen_list_versions_by_function_paginator(gen_lambda_client):40 return gen_lambda_client.get_paginator("list_versions_by_function")41@pytest.fixture42def gen_list_function_event_invoke_configs_paginator(gen_lambda_client):43 return gen_lambda_client.get_paginator("list_function_event_invoke_configs")44@pytest.fixture45def gen_list_provisioned_concurrency_configs_paginator(gen_lambda_client):46 return gen_lambda_client.get_paginator("list_provisioned_concurrency_configs")47@pytest.fixture48def gen_list_code_signing_configs_paginator(gen_lambda_client):49 return gen_lambda_client.get_paginator("list_code_signing_configs")50@pytest.fixture51def gen_list_functions_by_code_signing_config_paginator(gen_lambda_client):...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!