Best Python code snippet using localstack_python
transit_gateway.py
Source:transit_gateway.py
...133 "MESSAGE": f"deleting tgw peering attachment {peer.attachment_id}",134 }135 self.logger.debug(str(log_message))136 try:137 self.ec2_client.delete_transit_gateway_peering_attachment(138 TransitGatewayAttachmentId=peer.attachment_id139 )140 except (KeyError, ClientError) as err:141 log_message["EXCEPTION"] = str(err)142 self.logger.error(str(log_message))143 raise144 async def accept_tgw_peering_attachment(self, peer: TGWPeer) -> None:145 """Accepts a transit gateway peering attachment request146 Args:147 tgw_attach_id (str): ID of the tgw attachment148 Raise:149 WaiterError, ClientError150 """151 log_message = {...
test_transit_gateway.py
Source:test_transit_gateway.py
...75 )76 assert isinstance(peers[0], TGWPeer)77 assert peers[0] == sample_peer78 # clean-up79 tgw.ec2_client.delete_transit_gateway_peering_attachment(80 TransitGatewayAttachmentId=attachment["TransitGatewayAttachmentId"]81 )82 tgw.ec2_client.delete_transit_gateway(83 TransitGatewayId=sample_tgw1["TransitGateway"]["TransitGatewayId"]84 )85 tgw.ec2_client.delete_transit_gateway(86 TransitGatewayId=sample_tgw2["TransitGateway"]["TransitGatewayId"]87 )88 def test__fail__client_error(self):89 """fail with client error"""90 tgw = TGWPeering()91 stubber = Stubber(tgw.ec2_client)92 _err_code = "InternalException"93 _message = "test error"...
cleanup.py
Source:cleanup.py
...43response = client.delete_transit_gateway_route(44 DestinationCidrBlock='172.16.0.0/24',45 TransitGatewayRouteTableId=(tgw_rt_id_eu_west_1)46)47response = client.delete_transit_gateway_peering_attachment(48 TransitGatewayAttachmentId=(tgw_attachment_id)...
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!!