def test_detach(self): ctx = self.get_mock_ctx("VpnGateway") self.vpn_gateway.resource_id = 'vpn gateway' config = {VPC_ID: 'vpc'} iface = MagicMock() iface.detach = self.mock_return(config) vpn_gateway.detach(ctx, iface, config) self.assertEqual(self.vpn_gateway.resource_id, 'vpn gateway')
def test_detach_with_relationships(self): ctx = self.get_mock_ctx("VpnGateway", type_hierarchy=[VPC_TYPE]) config = {VPNGATEWAY_ID: 'vpn gateway'} self.vpn_gateway.resource_id = config[VPNGATEWAY_ID] iface = MagicMock() iface.detach = self.mock_return(config) ctx.instance.runtime_properties['vpc_id'] = 'vpc' vpn_gateway.detach(ctx, iface, config) self.assertEqual(self.vpn_gateway.resource_id, 'vpn gateway')