How to use delete_vpn_connection_route method in localstack

Best Python code snippet using localstack_python

ec2.py

Source:ec2.py Github

copy

Full Screen

...180 self.ec2Client.delete_vpn_connection(181 VpnConnectionId=vpnid,182 DryRun=noop183 )184 def delete_vpn_connection_route(self, cidr, vpnid):185 self.ec2Client.delete_vpn_connection_route(186 DestinationCidrBlock=cidr,187 VpnConnectionId=vpnid188 )189 def delete_vpn_gateway(self, vpngwid, noop=False):190 self.ec2Client.delete_vpn_gateway(191 VpnGatewayId=vpngwid,192 DryRun=noop193 )194 def create_tags(self, resources, tags, noop=False):195 self.ec2Client.create_tags(196 DryRun=noop,197 Resources=resources,198 Tags=tags199 )...

Full Screen

Full Screen

test_vpn_connection_route.py

Source:test_vpn_connection_route.py Github

copy

Full Screen

1# Copyright (c) 2017 GigaSpaces Technologies Ltd. All rights reserved2#3# Licensed under the Apache License, Version 2.0 (the "License");4# you may not use this file except in compliance with the License.5# You may obtain a copy of the License at6#7# http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS,11# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12# * See the License for the specific language governing permissions and13# * limitations under the License.14from __future__ import unicode_literals15import unittest16from mock import patch, MagicMock17from cloudify_awssdk.common.tests.test_base import TestBase, mock_decorator18from cloudify_awssdk.ec2.resources.vpn_connection_route\19 import EC2VPNConnectionRoute20from cloudify_awssdk.ec2.resources import vpn_connection_route21from cloudify_awssdk.common import constants22class TestEC2VPNConnectionRoute(TestBase):23 def setUp(self):24 super(TestEC2VPNConnectionRoute, self).setUp()25 self.vpn_connection_route =\26 EC2VPNConnectionRoute("ctx_node",27 resource_id=True,28 client=True, logger=None)29 mock1 = patch('cloudify_awssdk.common.decorators.aws_resource',30 mock_decorator)31 mock1.start()32 reload(vpn_connection_route)33 def test_class_create(self):34 params = \35 {36 'DestinationCidrBlock': 'destination_cidr_block',37 'VpnConnectionId': 'vpn_connection_id_test',38 }39 response = None40 self.vpn_connection_route.client = self.make_client_function(41 'create_vpn_connection_route', return_value=response)42 self.assertEqual(self.vpn_connection_route.create(params), None)43 def test_class_delete(self):44 params = \45 {46 'DestinationCidrBlock': 'destination_cidr_block',47 'VpnConnectionId': 'vpn_connection_id_test',48 }49 response = None50 self.vpn_connection_route.client = self.make_client_function(51 'delete_vpn_connection_route', return_value=response)52 self.assertEqual(self.vpn_connection_route.delete(params), None)53 def test_prepare(self):54 ctx = self.get_mock_ctx("EC2VPNConnectionRoute")55 vpn_connection_route.prepare(ctx, 'config')56 self.assertEqual(57 ctx.instance.runtime_properties['resource_config'],58 'config')59 def test_create(self):60 iface = MagicMock()61 ctx = self.get_mock_ctx("EC2VPNConnectionRoute")62 config = \63 {64 'DestinationCidrBlock': 'destination_cidr_block',65 'VpnConnectionId': 'vpn_connection_id_test',66 }67 response = None68 iface.create = self.mock_return(response)69 vpn_connection_route.create(ctx, iface, config)70 self.assertEqual(71 ctx.instance.runtime_properties[constants.EXTERNAL_RESOURCE_ID],72 'vpn_connection_id_test'73 )74 def test_delete(self):75 iface = MagicMock()76 ctx = self.get_mock_ctx("EC2VPNConnectionRoute")77 vpn_connection_route.delete(ctx, iface, {})78 self.assertTrue(iface.delete.called)79if __name__ == '__main__':...

Full Screen

Full Screen

vpn_connection_route.py

Source:vpn_connection_route.py Github

copy

Full Screen

...43 return self.make_client_call(44 'create_vpn_connection_route', params)45 def delete(self, params=None):46 """ Deletes an existing AWS EC2 VPN Connection Route."""47 self.client.delete_vpn_connection_route(**params)48@decorators.aws_resource(EC2VPNConnectionRoute, resource_type=RESOURCE_TYPE)49def prepare(ctx, resource_config, **_):50 """Prepares an AWS EC2 VPN Connection Route"""51 # Save the parameters52 ctx.instance.runtime_properties['resource_config'] = resource_config53@decorators.aws_resource(EC2VPNConnectionRoute, RESOURCE_TYPE)54def create(ctx, iface, resource_config, **_):55 """Creates an AWS EC2 VPN Connection Route"""56 params = dict() if not resource_config else resource_config.copy()57 resource_id = \58 utils.get_resource_id(59 ctx.node,60 ctx.instance,61 params.get(VPN_CONNECTION_ID),...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful