Best Python code snippet using localstack_python
test_cloudformation_integration.py
Source:test_cloudformation_integration.py
2import os3from localstack.utils.aws import aws_stack4from localstack.utils.common import short_uid5from localstack.utils.generic.wait_utils import wait_until6def test_events_sqs_sns_lambda(logs_client, events_client, sns_client, deploy_cfn_template):7 ref_id = short_uid()8 stack = deploy_cfn_template(9 template_path=os.path.join(10 os.path.dirname(__file__), "../templates/integration_events_sns_sqs_lambda.yaml"11 ),12 template_mapping={"ref_id": ref_id},13 )14 assert len(stack.outputs) == 715 lambda_name = stack.outputs["FnName"]16 bus_name = stack.outputs["EventBusName"]17 # verify SNS topic policy is present18 topic_arn = aws_stack.sns_topic_arn(f"topic-{ref_id}") # TODO: make this an output19 result = sns_client.get_topic_attributes(TopicArn=topic_arn)["Attributes"]20 assert json.loads(result.get("Policy")) == {...
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!!