<s> try : <EOL> from lxml import etree as ET <EOL> except ImportError : <EOL> from xml . etree import ElementTree as ET <EOL> import sys <EOL> from types import GeneratorType <EOL> from libcloud . utils . py3 import httplib <EOL> from libcloud . common . types import InvalidCredsError <EOL> from libcloud . common . dimensiondata import DimensionDataAPIException , NetworkDomainServicePlan <EOL> from libcloud . common . dimensiondata import DimensionDataServerCpuSpecification , DimensionDataServerDisk , DimensionDataServerVMWareTools <EOL> from libcloud . common . dimensiondata import DimensionDataTag , DimensionDataTagKey <EOL> from libcloud . common . dimensiondata import TYPES_URN <EOL> from libcloud . compute . drivers . dimensiondata import DimensionDataNodeDriver as DimensionData <EOL> from libcloud . compute . base import Node , NodeAuthPassword , NodeLocation <EOL> from libcloud . test import MockHttp , unittest <EOL> from libcloud . test . compute import TestCaseMixin <EOL> from libcloud . test . file_fixtures import ComputeFileFixtures <EOL> from libcloud . test . secrets import DIMENSIONDATA_PARAMS <EOL> from libcloud . utils . xml import fixxpath , findtext <EOL> class DimensionDataTests ( unittest . TestCase , TestCaseMixin ) : <EOL> def setUp ( self ) : <EOL> DimensionData . connectionCls . conn_classes = ( None , DimensionDataMockHttp ) <EOL> DimensionDataMockHttp . type = None <EOL> self . driver = DimensionData ( * DIMENSIONDATA_PARAMS ) <EOL> def test_invalid_region ( self ) : <EOL> with self . assertRaises ( ValueError ) : <EOL> DimensionData ( * DIMENSIONDATA_PARAMS , region = '<STR_LIT>' ) <EOL> def test_invalid_creds ( self ) : <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> with self . assertRaises ( InvalidCredsError ) : <EOL> self . driver . list_nodes ( ) <EOL> def test_get_account_details ( self ) : <EOL> DimensionDataMockHttp . type = None <EOL> ret = self . driver . connection . get_account_details ( ) <EOL> self . assertEqual ( ret . full_name , '<STR_LIT>' ) <EOL> self . assertEqual ( ret . first_name , '<STR_LIT>' ) <EOL> self . assertEqual ( ret . email , '<STR_LIT>' ) <EOL> def test_list_locations_response ( self ) : <EOL> DimensionDataMockHttp . type = None <EOL> ret = self . driver . list_locations ( ) <EOL> self . assertEqual ( len ( ret ) , <NUM_LIT:5> ) <EOL> first_loc = ret [ <NUM_LIT:0> ] <EOL> self . assertEqual ( first_loc . id , '<STR_LIT>' ) <EOL> self . assertEqual ( first_loc . name , '<STR_LIT>' ) <EOL> self . assertEqual ( first_loc . country , '<STR_LIT>' ) <EOL> def test_list_nodes_response ( self ) : <EOL> DimensionDataMockHttp . type = None <EOL> ret = self . driver . list_nodes ( ) <EOL> self . assertEqual ( len ( ret ) , <NUM_LIT:7> ) <EOL> def test_node_extras ( self ) : <EOL> DimensionDataMockHttp . type = None <EOL> ret = self . driver . list_nodes ( ) <EOL> self . assertTrue ( isinstance ( ret [ <NUM_LIT:0> ] . extra [ '<STR_LIT>' ] , DimensionDataServerVMWareTools ) ) <EOL> self . assertTrue ( isinstance ( ret [ <NUM_LIT:0> ] . extra [ '<STR_LIT>' ] , DimensionDataServerCpuSpecification ) ) <EOL> self . assertTrue ( isinstance ( ret [ <NUM_LIT:0> ] . extra [ '<STR_LIT>' ] , list ) ) <EOL> self . assertTrue ( isinstance ( ret [ <NUM_LIT:0> ] . extra [ '<STR_LIT>' ] [ <NUM_LIT:0> ] , DimensionDataServerDisk ) ) <EOL> self . assertEqual ( ret [ <NUM_LIT:0> ] . extra [ '<STR_LIT>' ] [ <NUM_LIT:0> ] . size_gb , <NUM_LIT:10> ) <EOL> self . assertTrue ( isinstance ( ret [ <NUM_LIT:1> ] . extra [ '<STR_LIT>' ] , list ) ) <EOL> self . assertTrue ( isinstance ( ret [ <NUM_LIT:1> ] . extra [ '<STR_LIT>' ] [ <NUM_LIT:0> ] , DimensionDataServerDisk ) ) <EOL> self . assertEqual ( ret [ <NUM_LIT:1> ] . extra [ '<STR_LIT>' ] [ <NUM_LIT:0> ] . size_gb , <NUM_LIT:10> ) <EOL> def test_server_states ( self ) : <EOL> DimensionDataMockHttp . type = None <EOL> ret = self . driver . list_nodes ( ) <EOL> self . assertTrue ( ret [ <NUM_LIT:0> ] . state == '<STR_LIT>' ) <EOL> self . assertTrue ( ret [ <NUM_LIT:1> ] . state == '<STR_LIT>' ) <EOL> self . assertTrue ( ret [ <NUM_LIT:2> ] . state == '<STR_LIT>' ) <EOL> self . assertTrue ( ret [ <NUM_LIT:3> ] . state == '<STR_LIT>' ) <EOL> self . assertTrue ( ret [ <NUM_LIT:4> ] . state == '<STR_LIT>' ) <EOL> self . assertTrue ( ret [ <NUM_LIT:5> ] . state == '<STR_LIT>' ) <EOL> self . assertTrue ( ret [ <NUM_LIT:6> ] . state == '<STR_LIT>' ) <EOL> self . assertEqual ( len ( ret ) , <NUM_LIT:7> ) <EOL> def test_list_nodes_response_PAGINATED ( self ) : <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> ret = self . driver . list_nodes ( ) <EOL> self . assertEqual ( len ( ret ) , <NUM_LIT:9> ) <EOL> def test_paginated_mcp2_call_with_page_size ( self ) : <EOL> self . driver . connection . _get_orgId ( ) <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> node_list_generator = self . driver . connection . paginated_request_with_orgId_api_2 ( '<STR_LIT>' , page_size = <NUM_LIT:50> ) <EOL> self . assertTrue ( isinstance ( node_list_generator , GeneratorType ) ) <EOL> def test_list_nodes_response_strings_ALLFILTERS ( self ) : <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> ret = self . driver . list_nodes ( ex_location = '<STR_LIT>' , ex_name = '<STR_LIT>' , <EOL> ex_ipv6 = '<STR_LIT>' , ex_ipv4 = '<STR_LIT>' , ex_vlan = '<STR_LIT>' , <EOL> ex_image = '<STR_LIT>' , ex_deployed = True , <EOL> ex_started = True , ex_state = '<STR_LIT>' , <EOL> ex_network = '<STR_LIT>' , ex_network_domain = '<STR_LIT>' ) <EOL> self . assertTrue ( isinstance ( ret , list ) ) <EOL> self . assertEqual ( len ( ret ) , <NUM_LIT:7> ) <EOL> node = ret [ <NUM_LIT:3> ] <EOL> self . assertTrue ( isinstance ( node . extra [ '<STR_LIT>' ] , list ) ) <EOL> self . assertTrue ( isinstance ( node . extra [ '<STR_LIT>' ] [ <NUM_LIT:0> ] , DimensionDataServerDisk ) ) <EOL> disk = node . extra [ '<STR_LIT>' ] [ <NUM_LIT:0> ] <EOL> self . assertEqual ( disk . id , "<STR_LIT>" ) <EOL> self . assertEqual ( disk . scsi_id , <NUM_LIT:0> ) <EOL> self . assertEqual ( disk . size_gb , <NUM_LIT:50> ) <EOL> self . assertEqual ( disk . speed , "<STR_LIT>" ) <EOL> self . assertEqual ( disk . state , "<STR_LIT>" ) <EOL> def test_list_nodes_response_LOCATION ( self ) : <EOL> DimensionDataMockHttp . type = None <EOL> ret = self . driver . list_locations ( ) <EOL> first_loc = ret [ <NUM_LIT:0> ] <EOL> ret = self . driver . list_nodes ( ex_location = first_loc ) <EOL> for node in ret : <EOL> self . assertEqual ( node . extra [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_list_nodes_response_LOCATION_STR ( self ) : <EOL> DimensionDataMockHttp . type = None <EOL> ret = self . driver . list_nodes ( ex_location = '<STR_LIT>' ) <EOL> for node in ret : <EOL> self . assertEqual ( node . extra [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_list_sizes_response ( self ) : <EOL> DimensionDataMockHttp . type = None <EOL> ret = self . driver . list_sizes ( ) <EOL> self . assertEqual ( len ( ret ) , <NUM_LIT:1> ) <EOL> size = ret [ <NUM_LIT:0> ] <EOL> self . assertEqual ( size . name , '<STR_LIT:default>' ) <EOL> def test_reboot_node_response ( self ) : <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> ret = node . reboot ( ) <EOL> self . assertTrue ( ret is True ) <EOL> def test_reboot_node_response_INPROGRESS ( self ) : <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> node . reboot ( ) <EOL> def test_destroy_node_response ( self ) : <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> ret = node . destroy ( ) <EOL> self . assertTrue ( ret is True ) <EOL> def test_destroy_node_response_RESOURCE_BUSY ( self ) : <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> node . destroy ( ) <EOL> def test_list_images ( self ) : <EOL> images = self . driver . list_images ( ) <EOL> self . assertEqual ( len ( images ) , <NUM_LIT:3> ) <EOL> self . assertEqual ( images [ <NUM_LIT:0> ] . name , '<STR_LIT>' ) <EOL> self . assertEqual ( images [ <NUM_LIT:0> ] . id , '<STR_LIT>' ) <EOL> self . assertEqual ( images [ <NUM_LIT:0> ] . extra [ '<STR_LIT:location>' ] . id , '<STR_LIT>' ) <EOL> self . assertEqual ( images [ <NUM_LIT:0> ] . extra [ '<STR_LIT>' ] . cpu_count , <NUM_LIT:2> ) <EOL> self . assertEqual ( images [ <NUM_LIT:0> ] . extra [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_clean_failed_deployment_response_with_node ( self ) : <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> ret = self . driver . ex_clean_failed_deployment ( node ) <EOL> self . assertTrue ( ret is True ) <EOL> def test_clean_failed_deployment_response_with_node_id ( self ) : <EOL> node = '<STR_LIT>' <EOL> ret = self . driver . ex_clean_failed_deployment ( node ) <EOL> self . assertTrue ( ret is True ) <EOL> def test_ex_list_customer_images ( self ) : <EOL> images = self . driver . ex_list_customer_images ( ) <EOL> self . assertEqual ( len ( images ) , <NUM_LIT:3> ) <EOL> self . assertEqual ( images [ <NUM_LIT:0> ] . name , '<STR_LIT>' ) <EOL> self . assertEqual ( images [ <NUM_LIT:0> ] . id , '<STR_LIT>' ) <EOL> self . assertEqual ( images [ <NUM_LIT:0> ] . extra [ '<STR_LIT:location>' ] . id , '<STR_LIT>' ) <EOL> self . assertEqual ( images [ <NUM_LIT:0> ] . extra [ '<STR_LIT>' ] . cpu_count , <NUM_LIT:4> ) <EOL> self . assertEqual ( images [ <NUM_LIT:0> ] . extra [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_create_node_response ( self ) : <EOL> rootPw = NodeAuthPassword ( '<STR_LIT>' ) <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] <EOL> network = self . driver . ex_list_networks ( ) [ <NUM_LIT:0> ] <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , image = image , auth = rootPw , <EOL> ex_description = '<STR_LIT>' , ex_network = network , <EOL> ex_is_started = False ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> def test_create_node_response_no_pass_random_gen ( self ) : <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] <EOL> network = self . driver . ex_list_networks ( ) [ <NUM_LIT:0> ] <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , image = image , auth = None , <EOL> ex_description = '<STR_LIT>' , ex_network = network , <EOL> ex_is_started = False ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> self . assertTrue ( '<STR_LIT:password>' in node . extra ) <EOL> def test_create_node_response_no_pass_customer_windows ( self ) : <EOL> image = self . driver . ex_list_customer_images ( ) [ <NUM_LIT:1> ] <EOL> network = self . driver . ex_list_networks ( ) [ <NUM_LIT:0> ] <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , image = image , auth = None , <EOL> ex_description = '<STR_LIT>' , ex_network = network , <EOL> ex_is_started = False ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> self . assertTrue ( '<STR_LIT:password>' in node . extra ) <EOL> def test_create_node_response_no_pass_customer_windows_STR ( self ) : <EOL> image = self . driver . ex_list_customer_images ( ) [ <NUM_LIT:1> ] . id <EOL> network = self . driver . ex_list_networks ( ) [ <NUM_LIT:0> ] <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , image = image , auth = None , <EOL> ex_description = '<STR_LIT>' , ex_network = network , <EOL> ex_is_started = False ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> self . assertTrue ( '<STR_LIT:password>' in node . extra ) <EOL> def test_create_node_response_no_pass_customer_linux ( self ) : <EOL> image = self . driver . ex_list_customer_images ( ) [ <NUM_LIT:0> ] <EOL> network = self . driver . ex_list_networks ( ) [ <NUM_LIT:0> ] <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , image = image , auth = None , <EOL> ex_description = '<STR_LIT>' , ex_network = network , <EOL> ex_is_started = False ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> self . assertTrue ( '<STR_LIT:password>' not in node . extra ) <EOL> def test_create_node_response_no_pass_customer_linux_STR ( self ) : <EOL> image = self . driver . ex_list_customer_images ( ) [ <NUM_LIT:0> ] . id <EOL> network = self . driver . ex_list_networks ( ) [ <NUM_LIT:0> ] <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , image = image , auth = None , <EOL> ex_description = '<STR_LIT>' , ex_network = network , <EOL> ex_is_started = False ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> self . assertTrue ( '<STR_LIT:password>' not in node . extra ) <EOL> def test_create_node_response_STR ( self ) : <EOL> rootPw = '<STR_LIT>' <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] . id <EOL> network = self . driver . ex_list_networks ( ) [ <NUM_LIT:0> ] . id <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , image = image , auth = rootPw , <EOL> ex_description = '<STR_LIT>' , ex_network = network , <EOL> ex_is_started = False ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> def test_create_node_response_network_domain ( self ) : <EOL> rootPw = NodeAuthPassword ( '<STR_LIT>' ) <EOL> location = self . driver . ex_get_location_by_id ( '<STR_LIT>' ) <EOL> image = self . driver . list_images ( location = location ) [ <NUM_LIT:0> ] <EOL> network_domain = self . driver . ex_list_network_domains ( location = location ) [ <NUM_LIT:0> ] <EOL> vlan = self . driver . ex_list_vlans ( location = location ) [ <NUM_LIT:0> ] <EOL> cpu = DimensionDataServerCpuSpecification ( <EOL> cpu_count = <NUM_LIT:4> , <EOL> cores_per_socket = <NUM_LIT:1> , <EOL> performance = '<STR_LIT>' <EOL> ) <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , image = image , auth = rootPw , <EOL> ex_description = '<STR_LIT>' , <EOL> ex_network_domain = network_domain , <EOL> ex_vlan = vlan , <EOL> ex_is_started = False , ex_cpu_specification = cpu , <EOL> ex_memory_gb = <NUM_LIT:4> ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> def test_create_node_response_network_domain_STR ( self ) : <EOL> rootPw = NodeAuthPassword ( '<STR_LIT>' ) <EOL> location = self . driver . ex_get_location_by_id ( '<STR_LIT>' ) <EOL> image = self . driver . list_images ( location = location ) [ <NUM_LIT:0> ] <EOL> network_domain = self . driver . ex_list_network_domains ( location = location ) [ <NUM_LIT:0> ] . id <EOL> vlan = self . driver . ex_list_vlans ( location = location ) [ <NUM_LIT:0> ] . id <EOL> cpu = DimensionDataServerCpuSpecification ( <EOL> cpu_count = <NUM_LIT:4> , <EOL> cores_per_socket = <NUM_LIT:1> , <EOL> performance = '<STR_LIT>' <EOL> ) <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , image = image , auth = rootPw , <EOL> ex_description = '<STR_LIT>' , <EOL> ex_network_domain = network_domain , <EOL> ex_vlan = vlan , <EOL> ex_is_started = False , ex_cpu_specification = cpu , <EOL> ex_memory_gb = <NUM_LIT:4> ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> def test_create_node_no_network ( self ) : <EOL> rootPw = NodeAuthPassword ( '<STR_LIT>' ) <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] <EOL> with self . assertRaises ( ValueError ) : <EOL> self . driver . create_node ( name = '<STR_LIT>' , <EOL> image = image , <EOL> auth = rootPw , <EOL> ex_description = '<STR_LIT>' , <EOL> ex_network = None , <EOL> ex_is_started = False ) <EOL> def test_create_node_mcp1_ipv4 ( self ) : <EOL> rootPw = NodeAuthPassword ( '<STR_LIT>' ) <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , <EOL> image = image , <EOL> auth = rootPw , <EOL> ex_description = '<STR_LIT>' , <EOL> ex_primary_ipv4 = '<STR_LIT>' , <EOL> ex_is_started = False ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> def test_create_node_mcp1_network ( self ) : <EOL> rootPw = NodeAuthPassword ( '<STR_LIT>' ) <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , <EOL> image = image , <EOL> auth = rootPw , <EOL> ex_description = '<STR_LIT>' , <EOL> ex_network = '<STR_LIT>' , <EOL> ex_is_started = False ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> def test_create_node_mcp2_vlan ( self ) : <EOL> rootPw = NodeAuthPassword ( '<STR_LIT>' ) <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , <EOL> image = image , <EOL> auth = rootPw , <EOL> ex_description = '<STR_LIT>' , <EOL> ex_network_domain = '<STR_LIT>' , <EOL> ex_vlan = '<STR_LIT>' , <EOL> ex_is_started = False ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> def test_create_node_mcp2_ipv4 ( self ) : <EOL> rootPw = NodeAuthPassword ( '<STR_LIT>' ) <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , <EOL> image = image , <EOL> auth = rootPw , <EOL> ex_description = '<STR_LIT>' , <EOL> ex_network_domain = '<STR_LIT>' , <EOL> ex_primary_ipv4 = '<STR_LIT>' , <EOL> ex_is_started = False ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> def test_create_node_network_domain_no_vlan_or_ipv4 ( self ) : <EOL> rootPw = NodeAuthPassword ( '<STR_LIT>' ) <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] <EOL> with self . assertRaises ( ValueError ) : <EOL> self . driver . create_node ( name = '<STR_LIT>' , <EOL> image = image , <EOL> auth = rootPw , <EOL> ex_description = '<STR_LIT>' , <EOL> ex_network_domain = '<STR_LIT>' , <EOL> ex_is_started = False ) <EOL> def test_create_node_mcp2_additional_nics ( self ) : <EOL> rootPw = NodeAuthPassword ( '<STR_LIT>' ) <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] <EOL> additional_vlans = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> additional_ipv4 = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> node = self . driver . create_node ( name = '<STR_LIT>' , <EOL> image = image , <EOL> auth = rootPw , <EOL> ex_description = '<STR_LIT>' , <EOL> ex_network_domain = '<STR_LIT>' , <EOL> ex_primary_ipv4 = '<STR_LIT>' , <EOL> ex_additional_nics_vlan = additional_vlans , <EOL> ex_additional_nics_ipv4 = additional_ipv4 , <EOL> ex_is_started = False ) <EOL> self . assertEqual ( node . id , '<STR_LIT>' ) <EOL> self . assertEqual ( node . extra [ '<STR_LIT:status>' ] . action , '<STR_LIT>' ) <EOL> def test_create_node_bad_additional_nics_ipv4 ( self ) : <EOL> rootPw = NodeAuthPassword ( '<STR_LIT>' ) <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] <EOL> with self . assertRaises ( TypeError ) : <EOL> self . driver . create_node ( name = '<STR_LIT>' , <EOL> image = image , <EOL> auth = rootPw , <EOL> ex_description = '<STR_LIT>' , <EOL> ex_network_domain = '<STR_LIT>' , <EOL> ex_vlan = '<STR_LIT>' , <EOL> ex_additional_nics_ipv4 = '<STR_LIT>' , <EOL> ex_is_started = False ) <EOL> def test_create_node_bad_additional_nics_vlan ( self ) : <EOL> rootPw = NodeAuthPassword ( '<STR_LIT>' ) <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] <EOL> with self . assertRaises ( TypeError ) : <EOL> self . driver . create_node ( name = '<STR_LIT>' , <EOL> image = image , <EOL> auth = rootPw , <EOL> ex_description = '<STR_LIT>' , <EOL> ex_network_domain = '<STR_LIT>' , <EOL> ex_vlan = '<STR_LIT>' , <EOL> ex_additional_nics_vlan = '<STR_LIT>' , <EOL> ex_is_started = False ) <EOL> def test_ex_shutdown_graceful ( self ) : <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> ret = self . driver . ex_shutdown_graceful ( node ) <EOL> self . assertTrue ( ret is True ) <EOL> def test_ex_shutdown_graceful_INPROGRESS ( self ) : <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> self . driver . ex_shutdown_graceful ( node ) <EOL> def test_ex_start_node ( self ) : <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> ret = self . driver . ex_start_node ( node ) <EOL> self . assertTrue ( ret is True ) <EOL> def test_ex_start_node_INPROGRESS ( self ) : <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> self . driver . ex_start_node ( node ) <EOL> def test_ex_power_off ( self ) : <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> ret = self . driver . ex_power_off ( node ) <EOL> self . assertTrue ( ret is True ) <EOL> def test_ex_update_vm_tools ( self ) : <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> ret = self . driver . ex_update_vm_tools ( node ) <EOL> self . assertTrue ( ret is True ) <EOL> def test_ex_power_off_INPROGRESS ( self ) : <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> self . driver . ex_power_off ( node ) <EOL> def test_ex_reset ( self ) : <EOL> node = Node ( id = '<STR_LIT>' , name = None , state = None , <EOL> public_ips = None , private_ips = None , driver = self . driver ) <EOL> ret = self . driver . ex_reset ( node ) <EOL> self . assertTrue ( ret is True ) <EOL> def test_ex_attach_node_to_vlan ( self ) : <EOL> node = self . driver . ex_get_node_by_id ( '<STR_LIT>' ) <EOL> vlan = self . driver . ex_get_vlan ( '<STR_LIT>' ) <EOL> ret = self . driver . ex_attach_node_to_vlan ( node , vlan ) <EOL> self . assertTrue ( ret is True ) <EOL> def test_ex_destroy_nic ( self ) : <EOL> node = self . driver . ex_destroy_nic ( '<STR_LIT>' ) <EOL> self . assertTrue ( node ) <EOL> def test_list_networks ( self ) : <EOL> nets = self . driver . list_networks ( ) <EOL> self . assertEqual ( nets [ <NUM_LIT:0> ] . name , '<STR_LIT>' ) <EOL> self . assertTrue ( isinstance ( nets [ <NUM_LIT:0> ] . location , NodeLocation ) ) <EOL> def test_ex_create_network ( self ) : <EOL> location = self . driver . ex_get_location_by_id ( '<STR_LIT>' ) <EOL> net = self . driver . ex_create_network ( location , "<STR_LIT>" , "<STR_LIT:test>" ) <EOL> self . assertEqual ( net . id , "<STR_LIT>" ) <EOL> self . assertEqual ( net . name , "<STR_LIT>" ) <EOL> def test_ex_create_network_NO_DESCRIPTION ( self ) : <EOL> location = self . driver . ex_get_location_by_id ( '<STR_LIT>' ) <EOL> net = self . driver . ex_create_network ( location , "<STR_LIT>" ) <EOL> self . assertEqual ( net . id , "<STR_LIT>" ) <EOL> self . assertEqual ( net . name , "<STR_LIT>" ) <EOL> def test_ex_delete_network ( self ) : <EOL> net = self . driver . ex_list_networks ( ) [ <NUM_LIT:0> ] <EOL> result = self . driver . ex_delete_network ( net ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_rename_network ( self ) : <EOL> net = self . driver . ex_list_networks ( ) [ <NUM_LIT:0> ] <EOL> result = self . driver . ex_rename_network ( net , "<STR_LIT>" ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_create_network_domain ( self ) : <EOL> location = self . driver . ex_get_location_by_id ( '<STR_LIT>' ) <EOL> plan = NetworkDomainServicePlan . ADVANCED <EOL> net = self . driver . ex_create_network_domain ( location = location , <EOL> name = '<STR_LIT:test>' , <EOL> description = '<STR_LIT:test>' , <EOL> service_plan = plan ) <EOL> self . assertEqual ( net . name , '<STR_LIT:test>' ) <EOL> self . assertTrue ( net . id , '<STR_LIT>' ) <EOL> def test_ex_create_network_domain_NO_DESCRIPTION ( self ) : <EOL> location = self . driver . ex_get_location_by_id ( '<STR_LIT>' ) <EOL> plan = NetworkDomainServicePlan . ADVANCED <EOL> net = self . driver . ex_create_network_domain ( location = location , <EOL> name = '<STR_LIT:test>' , <EOL> service_plan = plan ) <EOL> self . assertEqual ( net . name , '<STR_LIT:test>' ) <EOL> self . assertTrue ( net . id , '<STR_LIT>' ) <EOL> def test_ex_get_network_domain ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> self . assertEqual ( net . id , '<STR_LIT>' ) <EOL> self . assertEqual ( net . description , '<STR_LIT>' ) <EOL> self . assertEqual ( net . name , '<STR_LIT:test>' ) <EOL> def test_ex_update_network_domain ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> net . name = '<STR_LIT>' <EOL> net2 = self . driver . ex_update_network_domain ( net ) <EOL> self . assertEqual ( net2 . name , '<STR_LIT>' ) <EOL> def test_ex_delete_network_domain ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> result = self . driver . ex_delete_network_domain ( net ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_list_networks ( self ) : <EOL> nets = self . driver . ex_list_networks ( ) <EOL> self . assertEqual ( nets [ <NUM_LIT:0> ] . name , '<STR_LIT>' ) <EOL> self . assertTrue ( isinstance ( nets [ <NUM_LIT:0> ] . location , NodeLocation ) ) <EOL> def test_ex_list_network_domains ( self ) : <EOL> nets = self . driver . ex_list_network_domains ( ) <EOL> self . assertEqual ( nets [ <NUM_LIT:0> ] . name , '<STR_LIT>' ) <EOL> self . assertTrue ( isinstance ( nets [ <NUM_LIT:0> ] . location , NodeLocation ) ) <EOL> def test_ex_list_network_domains_ALLFILTERS ( self ) : <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> nets = self . driver . ex_list_network_domains ( location = '<STR_LIT>' , name = '<STR_LIT>' , <EOL> service_plan = '<STR_LIT>' , state = '<STR_LIT>' ) <EOL> self . assertEqual ( nets [ <NUM_LIT:0> ] . name , '<STR_LIT>' ) <EOL> self . assertTrue ( isinstance ( nets [ <NUM_LIT:0> ] . location , NodeLocation ) ) <EOL> def test_ex_list_vlans ( self ) : <EOL> vlans = self . driver . ex_list_vlans ( ) <EOL> self . assertEqual ( vlans [ <NUM_LIT:0> ] . name , "<STR_LIT>" ) <EOL> def test_ex_list_vlans_ALLFILTERS ( self ) : <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> vlans = self . driver . ex_list_vlans ( location = '<STR_LIT>' , network_domain = '<STR_LIT>' , <EOL> name = '<STR_LIT>' , ipv4_address = '<STR_LIT>' , ipv6_address = '<STR_LIT>' , state = '<STR_LIT>' ) <EOL> self . assertEqual ( vlans [ <NUM_LIT:0> ] . name , "<STR_LIT>" ) <EOL> def test_ex_create_vlan ( self , ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> vlan = self . driver . ex_create_vlan ( network_domain = net , <EOL> name = '<STR_LIT:test>' , <EOL> private_ipv4_base_address = '<STR_LIT>' , <EOL> private_ipv4_prefix_size = '<STR_LIT>' , <EOL> description = '<STR_LIT>' ) <EOL> self . assertEqual ( vlan . id , '<STR_LIT>' ) <EOL> def test_ex_create_vlan_NO_DESCRIPTION ( self , ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> vlan = self . driver . ex_create_vlan ( network_domain = net , <EOL> name = '<STR_LIT:test>' , <EOL> private_ipv4_base_address = '<STR_LIT>' , <EOL> private_ipv4_prefix_size = '<STR_LIT>' ) <EOL> self . assertEqual ( vlan . id , '<STR_LIT>' ) <EOL> def test_ex_get_vlan ( self ) : <EOL> vlan = self . driver . ex_get_vlan ( '<STR_LIT>' ) <EOL> self . assertEqual ( vlan . id , '<STR_LIT>' ) <EOL> self . assertEqual ( vlan . description , '<STR_LIT>' ) <EOL> self . assertEqual ( vlan . status , '<STR_LIT>' ) <EOL> self . assertEqual ( vlan . name , '<STR_LIT>' ) <EOL> self . assertEqual ( vlan . private_ipv4_range_address , '<STR_LIT>' ) <EOL> self . assertEqual ( vlan . private_ipv4_range_size , <NUM_LIT> ) <EOL> self . assertEqual ( vlan . ipv6_range_size , <NUM_LIT:64> ) <EOL> self . assertEqual ( vlan . ipv6_range_address , '<STR_LIT>' ) <EOL> self . assertEqual ( vlan . ipv4_gateway , '<STR_LIT>' ) <EOL> self . assertEqual ( vlan . ipv6_gateway , '<STR_LIT>' ) <EOL> def test_ex_wait_for_state ( self ) : <EOL> self . driver . ex_wait_for_state ( '<STR_LIT>' , <EOL> self . driver . ex_get_vlan , <EOL> vlan_id = '<STR_LIT>' ) <EOL> def test_ex_wait_for_state_NODE ( self ) : <EOL> self . driver . ex_wait_for_state ( '<STR_LIT>' , <EOL> self . driver . ex_get_node_by_id , <EOL> id = '<STR_LIT>' ) <EOL> def test_ex_wait_for_state_FAIL ( self ) : <EOL> with self . assertRaises ( DimensionDataAPIException ) as context : <EOL> self . driver . ex_wait_for_state ( '<STR_LIT>' , <EOL> self . driver . ex_get_node_by_id , <EOL> id = '<STR_LIT>' , <EOL> timeout = <NUM_LIT:2> <EOL> ) <EOL> self . assertEqual ( context . exception . code , '<STR_LIT>' ) <EOL> self . assertTrue ( '<STR_LIT>' in context . exception . msg ) <EOL> def test_ex_update_vlan ( self ) : <EOL> vlan = self . driver . ex_get_vlan ( '<STR_LIT>' ) <EOL> vlan . name = '<STR_LIT>' <EOL> vlan2 = self . driver . ex_update_vlan ( vlan ) <EOL> self . assertEqual ( vlan2 . name , '<STR_LIT>' ) <EOL> def test_ex_delete_vlan ( self ) : <EOL> vlan = self . driver . ex_get_vlan ( '<STR_LIT>' ) <EOL> result = self . driver . ex_delete_vlan ( vlan ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_expand_vlan ( self ) : <EOL> vlan = self . driver . ex_get_vlan ( '<STR_LIT>' ) <EOL> vlan . private_ipv4_range_size = '<STR_LIT>' <EOL> vlan = self . driver . ex_expand_vlan ( vlan ) <EOL> self . assertEqual ( vlan . private_ipv4_range_size , '<STR_LIT>' ) <EOL> def test_ex_add_public_ip_block_to_network_domain ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> block = self . driver . ex_add_public_ip_block_to_network_domain ( net ) <EOL> self . assertEqual ( block . id , '<STR_LIT>' ) <EOL> def test_ex_list_public_ip_blocks ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> blocks = self . driver . ex_list_public_ip_blocks ( net ) <EOL> self . assertEqual ( blocks [ <NUM_LIT:0> ] . base_ip , '<STR_LIT>' ) <EOL> self . assertEqual ( blocks [ <NUM_LIT:0> ] . size , '<STR_LIT:2>' ) <EOL> self . assertEqual ( blocks [ <NUM_LIT:0> ] . id , '<STR_LIT>' ) <EOL> self . assertEqual ( blocks [ <NUM_LIT:0> ] . location . id , '<STR_LIT>' ) <EOL> self . assertEqual ( blocks [ <NUM_LIT:0> ] . network_domain . id , net . id ) <EOL> def test_ex_get_public_ip_block ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> block = self . driver . ex_get_public_ip_block ( '<STR_LIT>' ) <EOL> self . assertEqual ( block . base_ip , '<STR_LIT>' ) <EOL> self . assertEqual ( block . size , '<STR_LIT:2>' ) <EOL> self . assertEqual ( block . id , '<STR_LIT>' ) <EOL> self . assertEqual ( block . location . id , '<STR_LIT>' ) <EOL> self . assertEqual ( block . network_domain . id , net . id ) <EOL> def test_ex_delete_public_ip_block ( self ) : <EOL> block = self . driver . ex_get_public_ip_block ( '<STR_LIT>' ) <EOL> result = self . driver . ex_delete_public_ip_block ( block ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_list_firewall_rules ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rules = self . driver . ex_list_firewall_rules ( net ) <EOL> self . assertEqual ( rules [ <NUM_LIT:0> ] . id , '<STR_LIT>' ) <EOL> self . assertEqual ( rules [ <NUM_LIT:0> ] . network_domain . id , '<STR_LIT>' ) <EOL> self . assertEqual ( rules [ <NUM_LIT:0> ] . name , '<STR_LIT>' ) <EOL> self . assertEqual ( rules [ <NUM_LIT:0> ] . action , '<STR_LIT>' ) <EOL> self . assertEqual ( rules [ <NUM_LIT:0> ] . ip_version , '<STR_LIT>' ) <EOL> self . assertEqual ( rules [ <NUM_LIT:0> ] . protocol , '<STR_LIT>' ) <EOL> self . assertEqual ( rules [ <NUM_LIT:0> ] . source . ip_address , '<STR_LIT>' ) <EOL> self . assertTrue ( rules [ <NUM_LIT:0> ] . source . any_ip ) <EOL> self . assertTrue ( rules [ <NUM_LIT:0> ] . destination . any_ip ) <EOL> def test_ex_create_firewall_rule ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rules = self . driver . ex_list_firewall_rules ( net ) <EOL> rule = self . driver . ex_create_firewall_rule ( net , rules [ <NUM_LIT:0> ] , '<STR_LIT>' ) <EOL> self . assertEqual ( rule . id , '<STR_LIT>' ) <EOL> def test_ex_create_firewall_rule_with_specific_source_ip ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rules = self . driver . ex_list_firewall_rules ( net ) <EOL> specific_source_ip_rule = list ( filter ( lambda x : x . name == '<STR_LIT>' , <EOL> rules ) ) [ <NUM_LIT:0> ] <EOL> rule = self . driver . ex_create_firewall_rule ( net , specific_source_ip_rule , '<STR_LIT>' ) <EOL> self . assertEqual ( rule . id , '<STR_LIT>' ) <EOL> def test_ex_create_firewall_rule_address_list ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rule = self . driver . ex_list_firewall_rules ( net ) [ <NUM_LIT:0> ] <EOL> rule . source . address_list_id = '<STR_LIT>' <EOL> rule . destination . address_list_id = '<STR_LIT>' <EOL> self . driver . ex_create_firewall_rule ( net , rule , '<STR_LIT>' ) <EOL> def test_ex_create_firewall_rule_port_list ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rule = self . driver . ex_list_firewall_rules ( net ) [ <NUM_LIT:0> ] <EOL> rule . source . port_list_id = '<STR_LIT>' <EOL> rule . destination . port_list_id = '<STR_LIT>' <EOL> self . driver . ex_create_firewall_rule ( net , rule , '<STR_LIT>' ) <EOL> def test_ex_create_firewall_rule_ALL_VALUES ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rules = self . driver . ex_list_firewall_rules ( net ) <EOL> for rule in rules : <EOL> self . driver . ex_create_firewall_rule ( net , rule , '<STR_LIT>' ) <EOL> def test_ex_create_firewall_rule_WITH_POSITION_RULE ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rules = self . driver . ex_list_firewall_rules ( net ) <EOL> rule = self . driver . ex_create_firewall_rule ( net , rules [ - <NUM_LIT:2> ] , '<STR_LIT>' , rules [ - <NUM_LIT:1> ] ) <EOL> self . assertEqual ( rule . id , '<STR_LIT>' ) <EOL> def test_ex_create_firewall_rule_WITH_POSITION_RULE_STR ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rules = self . driver . ex_list_firewall_rules ( net ) <EOL> rule = self . driver . ex_create_firewall_rule ( net , rules [ - <NUM_LIT:2> ] , '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( rule . id , '<STR_LIT>' ) <EOL> def test_ex_create_firewall_rule_FAIL_POSITION ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rules = self . driver . ex_list_firewall_rules ( net ) <EOL> with self . assertRaises ( ValueError ) : <EOL> self . driver . ex_create_firewall_rule ( net , rules [ <NUM_LIT:0> ] , '<STR_LIT>' ) <EOL> def test_ex_create_firewall_rule_FAIL_POSITION_WITH_RULE ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rules = self . driver . ex_list_firewall_rules ( net ) <EOL> with self . assertRaises ( ValueError ) : <EOL> self . driver . ex_create_firewall_rule ( net , rules [ <NUM_LIT:0> ] , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def test_ex_get_firewall_rule ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rule = self . driver . ex_get_firewall_rule ( net , '<STR_LIT>' ) <EOL> self . assertEqual ( rule . id , '<STR_LIT>' ) <EOL> def test_ex_set_firewall_rule_state ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rule = self . driver . ex_get_firewall_rule ( net , '<STR_LIT>' ) <EOL> result = self . driver . ex_set_firewall_rule_state ( rule , False ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_delete_firewall_rule ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rule = self . driver . ex_get_firewall_rule ( net , '<STR_LIT>' ) <EOL> result = self . driver . ex_delete_firewall_rule ( rule ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_create_nat_rule ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rule = self . driver . ex_create_nat_rule ( net , '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( rule . id , '<STR_LIT>' ) <EOL> def test_ex_list_nat_rules ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rules = self . driver . ex_list_nat_rules ( net ) <EOL> self . assertEqual ( rules [ <NUM_LIT:0> ] . id , '<STR_LIT>' ) <EOL> self . assertEqual ( rules [ <NUM_LIT:0> ] . internal_ip , '<STR_LIT>' ) <EOL> self . assertEqual ( rules [ <NUM_LIT:0> ] . external_ip , '<STR_LIT>' ) <EOL> def test_ex_get_nat_rule ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rule = self . driver . ex_get_nat_rule ( net , '<STR_LIT>' ) <EOL> self . assertEqual ( rule . id , '<STR_LIT>' ) <EOL> self . assertEqual ( rule . internal_ip , '<STR_LIT>' ) <EOL> self . assertEqual ( rule . external_ip , '<STR_LIT>' ) <EOL> def test_ex_delete_nat_rule ( self ) : <EOL> net = self . driver . ex_get_network_domain ( '<STR_LIT>' ) <EOL> rule = self . driver . ex_get_nat_rule ( net , '<STR_LIT>' ) <EOL> result = self . driver . ex_delete_nat_rule ( rule ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_enable_monitoring ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> result = self . driver . ex_enable_monitoring ( node , "<STR_LIT>" ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_disable_monitoring ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> result = self . driver . ex_disable_monitoring ( node ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_change_monitoring_plan ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> result = self . driver . ex_update_monitoring_plan ( node , "<STR_LIT>" ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_add_storage_to_node ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> result = self . driver . ex_add_storage_to_node ( node , <NUM_LIT:30> , '<STR_LIT>' ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_remove_storage_from_node ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> result = self . driver . ex_remove_storage_from_node ( node , <NUM_LIT:0> ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_change_storage_speed ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> result = self . driver . ex_change_storage_speed ( node , <NUM_LIT:1> , '<STR_LIT>' ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_change_storage_size ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> result = self . driver . ex_change_storage_size ( node , <NUM_LIT:1> , <NUM_LIT:100> ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_clone_node_to_image ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> result = self . driver . ex_clone_node_to_image ( node , '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_update_node ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> result = self . driver . ex_update_node ( node , '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT:2> , <NUM_LIT> ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_reconfigure_node ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> result = self . driver . ex_reconfigure_node ( node , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:1> , '<STR_LIT>' ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_get_location_by_id ( self ) : <EOL> location = self . driver . ex_get_location_by_id ( '<STR_LIT>' ) <EOL> self . assertTrue ( location . id , '<STR_LIT>' ) <EOL> def test_ex_get_location_by_id_NO_LOCATION ( self ) : <EOL> location = self . driver . ex_get_location_by_id ( None ) <EOL> self . assertIsNone ( location ) <EOL> def test_ex_get_base_image_by_id ( self ) : <EOL> image_id = self . driver . list_images ( ) [ <NUM_LIT:0> ] . id <EOL> image = self . driver . ex_get_base_image_by_id ( image_id ) <EOL> self . assertEqual ( image . extra [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_ex_get_customer_image_by_id ( self ) : <EOL> image_id = self . driver . ex_list_customer_images ( ) [ <NUM_LIT:1> ] . id <EOL> image = self . driver . ex_get_customer_image_by_id ( image_id ) <EOL> self . assertEqual ( image . extra [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_ex_get_image_by_id_base_img ( self ) : <EOL> image_id = self . driver . list_images ( ) [ <NUM_LIT:1> ] . id <EOL> image = self . driver . ex_get_base_image_by_id ( image_id ) <EOL> self . assertEqual ( image . extra [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_ex_get_image_by_id_customer_img ( self ) : <EOL> image_id = self . driver . ex_list_customer_images ( ) [ <NUM_LIT:0> ] . id <EOL> image = self . driver . ex_get_customer_image_by_id ( image_id ) <EOL> self . assertEqual ( image . extra [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_ex_get_image_by_id_customer_FAIL ( self ) : <EOL> image_id = '<STR_LIT>' <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> self . driver . ex_get_base_image_by_id ( image_id ) <EOL> def test_ex_create_anti_affinity_rule ( self ) : <EOL> node_list = self . driver . list_nodes ( ) <EOL> success = self . driver . ex_create_anti_affinity_rule ( [ node_list [ <NUM_LIT:0> ] , node_list [ <NUM_LIT:1> ] ] ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_create_anti_affinity_rule_TUPLE ( self ) : <EOL> node_list = self . driver . list_nodes ( ) <EOL> success = self . driver . ex_create_anti_affinity_rule ( ( node_list [ <NUM_LIT:0> ] , node_list [ <NUM_LIT:1> ] ) ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_create_anti_affinity_rule_TUPLE_STR ( self ) : <EOL> node_list = self . driver . list_nodes ( ) <EOL> success = self . driver . ex_create_anti_affinity_rule ( ( node_list [ <NUM_LIT:0> ] . id , node_list [ <NUM_LIT:1> ] . id ) ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_create_anti_affinity_rule_FAIL_STR ( self ) : <EOL> node_list = '<STR_LIT:string>' <EOL> with self . assertRaises ( TypeError ) : <EOL> self . driver . ex_create_anti_affinity_rule ( node_list ) <EOL> def test_ex_create_anti_affinity_rule_FAIL_EXISTING ( self ) : <EOL> node_list = self . driver . list_nodes ( ) <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> self . driver . ex_create_anti_affinity_rule ( ( node_list [ <NUM_LIT:0> ] , node_list [ <NUM_LIT:1> ] ) ) <EOL> def test_ex_delete_anti_affinity_rule ( self ) : <EOL> net_domain = self . driver . ex_list_network_domains ( ) [ <NUM_LIT:0> ] <EOL> rule = self . driver . ex_list_anti_affinity_rules ( network_domain = net_domain ) [ <NUM_LIT:0> ] <EOL> success = self . driver . ex_delete_anti_affinity_rule ( rule ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_delete_anti_affinity_rule_STR ( self ) : <EOL> net_domain = self . driver . ex_list_network_domains ( ) [ <NUM_LIT:0> ] <EOL> rule = self . driver . ex_list_anti_affinity_rules ( network_domain = net_domain ) [ <NUM_LIT:0> ] <EOL> success = self . driver . ex_delete_anti_affinity_rule ( rule . id ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_delete_anti_affinity_rule_FAIL ( self ) : <EOL> net_domain = self . driver . ex_list_network_domains ( ) [ <NUM_LIT:0> ] <EOL> rule = self . driver . ex_list_anti_affinity_rules ( network_domain = net_domain ) [ <NUM_LIT:0> ] <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> self . driver . ex_delete_anti_affinity_rule ( rule ) <EOL> def test_ex_list_anti_affinity_rules_NETWORK_DOMAIN ( self ) : <EOL> net_domain = self . driver . ex_list_network_domains ( ) [ <NUM_LIT:0> ] <EOL> rules = self . driver . ex_list_anti_affinity_rules ( network_domain = net_domain ) <EOL> self . assertTrue ( isinstance ( rules , list ) ) <EOL> self . assertEqual ( len ( rules ) , <NUM_LIT:2> ) <EOL> self . assertTrue ( isinstance ( rules [ <NUM_LIT:0> ] . id , str ) ) <EOL> self . assertTrue ( isinstance ( rules [ <NUM_LIT:0> ] . node_list , list ) ) <EOL> def test_ex_list_anti_affinity_rules_NETWORK ( self ) : <EOL> network = self . driver . list_networks ( ) [ <NUM_LIT:0> ] <EOL> rules = self . driver . ex_list_anti_affinity_rules ( network = network ) <EOL> self . assertTrue ( isinstance ( rules , list ) ) <EOL> self . assertEqual ( len ( rules ) , <NUM_LIT:2> ) <EOL> self . assertTrue ( isinstance ( rules [ <NUM_LIT:0> ] . id , str ) ) <EOL> self . assertTrue ( isinstance ( rules [ <NUM_LIT:0> ] . node_list , list ) ) <EOL> def test_ex_list_anti_affinity_rules_NODE ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> rules = self . driver . ex_list_anti_affinity_rules ( node = node ) <EOL> self . assertTrue ( isinstance ( rules , list ) ) <EOL> self . assertEqual ( len ( rules ) , <NUM_LIT:2> ) <EOL> self . assertTrue ( isinstance ( rules [ <NUM_LIT:0> ] . id , str ) ) <EOL> self . assertTrue ( isinstance ( rules [ <NUM_LIT:0> ] . node_list , list ) ) <EOL> def test_ex_list_anti_affinity_rules_PAGINATED ( self ) : <EOL> net_domain = self . driver . ex_list_network_domains ( ) [ <NUM_LIT:0> ] <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> rules = self . driver . ex_list_anti_affinity_rules ( network_domain = net_domain ) <EOL> self . assertTrue ( isinstance ( rules , list ) ) <EOL> self . assertEqual ( len ( rules ) , <NUM_LIT:4> ) <EOL> self . assertTrue ( isinstance ( rules [ <NUM_LIT:0> ] . id , str ) ) <EOL> self . assertTrue ( isinstance ( rules [ <NUM_LIT:0> ] . node_list , list ) ) <EOL> def test_ex_list_anti_affinity_rules_ALLFILTERS ( self ) : <EOL> net_domain = self . driver . ex_list_network_domains ( ) [ <NUM_LIT:0> ] <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> rules = self . driver . ex_list_anti_affinity_rules ( network_domain = net_domain , filter_id = '<STR_LIT>' , filter_state = '<STR_LIT>' ) <EOL> self . assertTrue ( isinstance ( rules , list ) ) <EOL> self . assertEqual ( len ( rules ) , <NUM_LIT:2> ) <EOL> self . assertTrue ( isinstance ( rules [ <NUM_LIT:0> ] . id , str ) ) <EOL> self . assertTrue ( isinstance ( rules [ <NUM_LIT:0> ] . node_list , list ) ) <EOL> def test_ex_list_anti_affinity_rules_BAD_ARGS ( self ) : <EOL> with self . assertRaises ( ValueError ) : <EOL> self . driver . ex_list_anti_affinity_rules ( network = '<STR_LIT>' , network_domain = '<STR_LIT>' ) <EOL> def test_ex_create_tag_key ( self ) : <EOL> success = self . driver . ex_create_tag_key ( '<STR_LIT>' ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_create_tag_key_ALLPARAMS ( self ) : <EOL> self . driver . connection . _get_orgId ( ) <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> success = self . driver . ex_create_tag_key ( '<STR_LIT>' , description = "<STR_LIT>" , value_required = False , display_on_report = False ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_create_tag_key_BADREQUEST ( self ) : <EOL> self . driver . connection . _get_orgId ( ) <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> self . driver . ex_create_tag_key ( '<STR_LIT>' ) <EOL> def test_ex_list_tag_keys ( self ) : <EOL> tag_keys = self . driver . ex_list_tag_keys ( ) <EOL> self . assertTrue ( isinstance ( tag_keys , list ) ) <EOL> self . assertTrue ( isinstance ( tag_keys [ <NUM_LIT:0> ] , DimensionDataTagKey ) ) <EOL> self . assertTrue ( isinstance ( tag_keys [ <NUM_LIT:0> ] . id , str ) ) <EOL> def test_ex_list_tag_keys_ALLFILTERS ( self ) : <EOL> self . driver . connection . _get_orgId ( ) <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> self . driver . ex_list_tag_keys ( id = '<STR_LIT>' , name = '<STR_LIT>' , value_required = False , display_on_report = False ) <EOL> def test_ex_get_tag_by_id ( self ) : <EOL> tag = self . driver . ex_get_tag_key_by_id ( '<STR_LIT>' ) <EOL> self . assertTrue ( isinstance ( tag , DimensionDataTagKey ) ) <EOL> def test_ex_get_tag_by_id_NOEXIST ( self ) : <EOL> self . driver . connection . _get_orgId ( ) <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> self . driver . ex_get_tag_key_by_id ( '<STR_LIT>' ) <EOL> def test_ex_get_tag_by_name ( self ) : <EOL> self . driver . connection . _get_orgId ( ) <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> tag = self . driver . ex_get_tag_key_by_name ( '<STR_LIT>' ) <EOL> self . assertTrue ( isinstance ( tag , DimensionDataTagKey ) ) <EOL> def test_ex_get_tag_by_name_NOEXIST ( self ) : <EOL> with self . assertRaises ( ValueError ) : <EOL> self . driver . ex_get_tag_key_by_name ( '<STR_LIT>' ) <EOL> def test_ex_modify_tag_key_NAME ( self ) : <EOL> tag_key = self . driver . ex_list_tag_keys ( ) [ <NUM_LIT:0> ] <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> success = self . driver . ex_modify_tag_key ( tag_key , name = '<STR_LIT>' ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_modify_tag_key_NOTNAME ( self ) : <EOL> tag_key = self . driver . ex_list_tag_keys ( ) [ <NUM_LIT:0> ] <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> success = self . driver . ex_modify_tag_key ( tag_key , description = '<STR_LIT>' , value_required = False , display_on_report = True ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_modify_tag_key_NOCHANGE ( self ) : <EOL> tag_key = self . driver . ex_list_tag_keys ( ) [ <NUM_LIT:0> ] <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> self . driver . ex_modify_tag_key ( tag_key ) <EOL> def test_ex_remove_tag_key ( self ) : <EOL> tag_key = self . driver . ex_list_tag_keys ( ) [ <NUM_LIT:0> ] <EOL> success = self . driver . ex_remove_tag_key ( tag_key ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_remove_tag_key_NOEXIST ( self ) : <EOL> tag_key = self . driver . ex_list_tag_keys ( ) [ <NUM_LIT:0> ] <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> self . driver . ex_remove_tag_key ( tag_key ) <EOL> def test_ex_apply_tag_to_asset ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> success = self . driver . ex_apply_tag_to_asset ( node , '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_apply_tag_to_asset_NOVALUE ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> success = self . driver . ex_apply_tag_to_asset ( node , '<STR_LIT>' ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_apply_tag_to_asset_NOTAGKEY ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> self . driver . ex_apply_tag_to_asset ( node , '<STR_LIT>' ) <EOL> def test_ex_apply_tag_to_asset_BADASSETTYPE ( self ) : <EOL> network = self . driver . list_networks ( ) [ <NUM_LIT:0> ] <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> with self . assertRaises ( TypeError ) : <EOL> self . driver . ex_apply_tag_to_asset ( network , '<STR_LIT>' ) <EOL> def test_ex_remove_tag_from_asset ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> success = self . driver . ex_remove_tag_from_asset ( node , '<STR_LIT>' ) <EOL> self . assertTrue ( success ) <EOL> def test_ex_remove_tag_from_asset_NOTAG ( self ) : <EOL> node = self . driver . list_nodes ( ) [ <NUM_LIT:0> ] <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> with self . assertRaises ( DimensionDataAPIException ) : <EOL> self . driver . ex_remove_tag_from_asset ( node , '<STR_LIT>' ) <EOL> def test_ex_list_tags ( self ) : <EOL> tags = self . driver . ex_list_tags ( ) <EOL> self . assertTrue ( isinstance ( tags , list ) ) <EOL> self . assertTrue ( isinstance ( tags [ <NUM_LIT:0> ] , DimensionDataTag ) ) <EOL> self . assertTrue ( len ( tags ) == <NUM_LIT:3> ) <EOL> def test_ex_list_tags_ALLPARAMS ( self ) : <EOL> self . driver . connection . _get_orgId ( ) <EOL> DimensionDataMockHttp . type = '<STR_LIT>' <EOL> tags = self . driver . ex_list_tags ( asset_id = '<STR_LIT>' , asset_type = '<STR_LIT>' , <EOL> location = '<STR_LIT>' , tag_key_name = '<STR_LIT>' , <EOL> tag_key_id = '<STR_LIT>' , value = '<STR_LIT>' , <EOL> value_required = False , display_on_report = False ) <EOL> self . assertTrue ( isinstance ( tags , list ) ) <EOL> self . assertTrue ( isinstance ( tags [ <NUM_LIT:0> ] , DimensionDataTag ) ) <EOL> self . assertTrue ( len ( tags ) == <NUM_LIT:3> ) <EOL> def test_priv_location_to_location_id ( self ) : <EOL> location = self . driver . ex_get_location_by_id ( '<STR_LIT>' ) <EOL> self . assertEqual ( <EOL> self . driver . _location_to_location_id ( location ) , <EOL> '<STR_LIT>' <EOL> ) <EOL> def test_priv_location_to_location_id_STR ( self ) : <EOL> self . assertEqual ( <EOL> self . driver . _location_to_location_id ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' <EOL> ) <EOL> def test_priv_location_to_location_id_TYPEERROR ( self ) : <EOL> with self . assertRaises ( TypeError ) : <EOL> self . driver . _location_to_location_id ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] ) <EOL> def test_priv_image_needs_auth_os_img ( self ) : <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] <EOL> self . assertTrue ( self . driver . _image_needs_auth ( image ) ) <EOL> def test_priv_image_needs_auth_os_img_STR ( self ) : <EOL> image = self . driver . list_images ( ) [ <NUM_LIT:0> ] . id <EOL> self . assertTrue ( self . driver . _image_needs_auth ( image ) ) <EOL> def test_priv_image_needs_auth_cust_img_windows ( self ) : <EOL> image = self . driver . ex_list_customer_images ( ) [ <NUM_LIT:1> ] <EOL> self . assertTrue ( self . driver . _image_needs_auth ( image ) ) <EOL> def test_priv_image_needs_auth_cust_img_windows_STR ( self ) : <EOL> image = self . driver . ex_list_customer_images ( ) [ <NUM_LIT:1> ] . id <EOL> self . assertTrue ( self . driver . _image_needs_auth ( image ) ) <EOL> def test_priv_image_needs_auth_cust_img_linux ( self ) : <EOL> image = self . driver . ex_list_customer_images ( ) [ <NUM_LIT:0> ] <EOL> self . assertTrue ( not self . driver . _image_needs_auth ( image ) ) <EOL> def test_priv_image_needs_auth_cust_img_linux_STR ( self ) : <EOL> image = self . driver . ex_list_customer_images ( ) [ <NUM_LIT:0> ] . id <EOL> self . assertTrue ( not self . driver . _image_needs_auth ( image ) ) <EOL> class InvalidRequestError ( Exception ) : <EOL> def __init__ ( self , tag ) : <EOL> super ( InvalidRequestError , self ) . __init__ ( "<STR_LIT>" % tag ) <EOL> class DimensionDataMockHttp ( MockHttp ) : <EOL> fixtures = ComputeFileFixtures ( '<STR_LIT>' ) <EOL> def _oec_0_9_myaccount_UNAUTHORIZED ( self , method , url , body , headers ) : <EOL> return ( httplib . UNAUTHORIZED , "<STR_LIT>" , { } , httplib . responses [ httplib . UNAUTHORIZED ] ) <EOL> def _oec_0_9_myaccount ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_myaccount_INPROGRESS ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_myaccount_PAGINATED ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_myaccount_ALLFILTERS ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_base_image ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_base_imageWithDiskSpeed ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployed ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_pendingDeploy ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_datacenter ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11 ( self , method , url , body , headers ) : <EOL> body = None <EOL> action = url . split ( '<STR_LIT:?>' ) [ - <NUM_LIT:1> ] <EOL> if action == '<STR_LIT>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> elif action == '<STR_LIT>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> elif action == '<STR_LIT>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> elif action == '<STR_LIT:start>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> elif action == '<STR_LIT>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_11_INPROGRESS ( self , method , url , body , headers ) : <EOL> body = None <EOL> action = url . split ( '<STR_LIT:?>' ) [ - <NUM_LIT:1> ] <EOL> if action == '<STR_LIT>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> elif action == '<STR_LIT>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> elif action == '<STR_LIT>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> elif action == '<STR_LIT:start>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> elif action == '<STR_LIT>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation ( self , method , url , body , headers ) : <EOL> if method is "<STR_LIT:POST>" : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation_NA9 ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_4bba37be_506f_11e3_b29c_001517c4643e ( self , method , <EOL> url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSize ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1_changeSpeed ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_disk_1 ( self , method , url , body , headers ) : <EOL> action = url . split ( '<STR_LIT:?>' ) [ - <NUM_LIT:1> ] <EOL> if action == '<STR_LIT>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87 ( self , method , url , body , headers ) : <EOL> if method == '<STR_LIT:GET>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> if method == '<STR_LIT:POST>' : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_FAIL_EXISTING ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_07e3621a_a920_4a9a_943c_d8021f27f418 ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_antiAffinityRule_07e3621a_a920_4a9a_943c_d8021f27f418_FAIL ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deleteServer ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deleteServer_INPROGRESS ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_rebootServer ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_rebootServer_INPROGRESS ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server ( self , method , url , body , headers ) : <EOL> if url . endswith ( '<STR_LIT>' ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGESIZE50 ( self , method , url , body , headers ) : <EOL> if not url . endswith ( '<STR_LIT>' ) : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_PAGINATED ( self , method , url , body , headers ) : <EOL> if '<STR_LIT>' in url : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> else : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_ALLFILTERS ( self , method , url , body , headers ) : <EOL> ( _ , params ) = url . split ( '<STR_LIT:?>' ) <EOL> parameters = params . split ( '<STR_LIT:&>' ) <EOL> for parameter in parameters : <EOL> ( key , value ) = parameter . split ( '<STR_LIT:=>' ) <EOL> if key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT:name>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT:state>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT:True>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT:True>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> else : <EOL> raise ValueError ( "<STR_LIT>" . format ( key , value ) ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_antiAffinityRule ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_antiAffinityRule_ALLFILTERS ( self , method , url , body , headers ) : <EOL> ( _ , params ) = url . split ( '<STR_LIT:?>' ) <EOL> parameters = params . split ( '<STR_LIT:&>' ) <EOL> for parameter in parameters : <EOL> ( key , value ) = parameter . split ( '<STR_LIT:=>' ) <EOL> if key == '<STR_LIT:id>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT:state>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> pass <EOL> else : <EOL> raise ValueError ( "<STR_LIT>" . format ( key , value ) ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_antiAffinityRule_PAGINATED ( self , method , url , body , headers ) : <EOL> if '<STR_LIT>' in url : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> else : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_infrastructure_datacenter ( self , method , url , body , headers ) : <EOL> if url . endswith ( '<STR_LIT>' ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_infrastructure_datacenter_ALLFILTERS ( self , method , url , body , headers ) : <EOL> if url . endswith ( '<STR_LIT>' ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_updateVmwareTools ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_startServer ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_startServer_INPROGRESS ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_shutdownServer ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_shutdownServer_INPROGRESS ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_resetServer ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_powerOffServer ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_powerOffServer_INPROGRESS ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain_ALLFILTERS ( self , method , url , body , headers ) : <EOL> ( _ , params ) = url . split ( '<STR_LIT:?>' ) <EOL> parameters = params . split ( '<STR_LIT:&>' ) <EOL> for parameter in parameters : <EOL> ( key , value ) = parameter . split ( '<STR_LIT:=>' ) <EOL> if key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT:type>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT:name>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT:state>' : <EOL> assert value == '<STR_LIT>' <EOL> else : <EOL> raise ValueError ( "<STR_LIT>" . format ( key , value ) ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_vlan ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_vlan_ALLFILTERS ( self , method , url , body , headers ) : <EOL> ( _ , params ) = url . split ( '<STR_LIT:?>' ) <EOL> parameters = params . split ( '<STR_LIT:&>' ) <EOL> for parameter in parameters : <EOL> ( key , value ) = parameter . split ( '<STR_LIT:=>' ) <EOL> if key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT:name>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT:state>' : <EOL> assert value == '<STR_LIT>' <EOL> else : <EOL> raise ValueError ( "<STR_LIT>" . format ( key , value ) ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_deployServer ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> network = request . find ( fixxpath ( '<STR_LIT>' , TYPES_URN ) ) <EOL> network_info = request . find ( fixxpath ( '<STR_LIT>' , TYPES_URN ) ) <EOL> if network is not None : <EOL> if network_info is not None : <EOL> raise InvalidRequestError ( "<STR_LIT>" ) <EOL> ipv4 = findtext ( network , '<STR_LIT>' , TYPES_URN ) <EOL> networkId = findtext ( network , '<STR_LIT>' , TYPES_URN ) <EOL> if ipv4 is None and networkId is None : <EOL> raise InvalidRequestError ( '<STR_LIT>' ) <EOL> elif network_info is not None : <EOL> if network is not None : <EOL> raise InvalidRequestError ( "<STR_LIT>" ) <EOL> primary_nic = network_info . find ( fixxpath ( '<STR_LIT>' , TYPES_URN ) ) <EOL> ipv4 = findtext ( primary_nic , '<STR_LIT>' , TYPES_URN ) <EOL> vlanId = findtext ( primary_nic , '<STR_LIT>' , TYPES_URN ) <EOL> if ipv4 is None and vlanId is None : <EOL> raise InvalidRequestError ( '<STR_LIT>' ) <EOL> else : <EOL> raise InvalidRequestError ( '<STR_LIT>' ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_server_e75ead52_692f_4314_8725_c8a4f4d13a87 ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deployNetworkDomain ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_networkDomain_8cdfd607_f429_4df6_9352_162cfc0891be_ALLFILTERS ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editNetworkDomain ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteNetworkDomain ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deployVlan ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_vlan_0e56433f_d808_4669_821d_812769517ff8 ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editVlan ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteVlan ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_expandVlan ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_addPublicIpBlock ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_publicIpBlock_4487241a_f0ca_11e3_9315_d4bed9b167ba ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_publicIpBlock ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_publicIpBlock_9945dc4a_bdce_11e4_8c14_b8ca3a5d9ef8 ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_removePublicIpBlock ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_firewallRule ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createFirewallRule ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_firewallRule_d0a20f59_77b9_4f28_a63b_e58496b73a6c ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_editFirewallRule ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteFirewallRule ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_createNatRule ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_natRule ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_natRule_2187a636_7ebb_49a1_a2ff_5d617f496dce ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_network_deleteNatRule ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_addNic ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_removeNic ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_disableServerMonitoring ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_enableServerMonitoring ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_changeServerMonitoringPlan ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_c14b1a46_2428_44c1_9c1a_b20e6418d08c ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_6b4fb0c7_a57b_4f58_b59c_9958f94f971a ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_osImage_FAKE_IMAGE_ID ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage_5234e5c7_01de_4411_8b6e_baeb8d91cf5d ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage_2ffa36c8_1848_49eb_b4fa_9d908775f68c ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_image_customerImage_FAKE_IMAGE_ID ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_reconfigureServer ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_cleanServer ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_addDisk ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_removeDisk ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_createTagKey ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> name = findtext ( request , '<STR_LIT:name>' , TYPES_URN ) <EOL> description = findtext ( request , '<STR_LIT:description>' , TYPES_URN ) <EOL> value_required = findtext ( request , '<STR_LIT>' , TYPES_URN ) <EOL> display_on_report = findtext ( request , '<STR_LIT>' , TYPES_URN ) <EOL> if name is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if description is not None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if value_required is None or value_required != '<STR_LIT:true>' : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if display_on_report is None or display_on_report != '<STR_LIT:true>' : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_createTagKey_ALLPARAMS ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> name = findtext ( request , '<STR_LIT:name>' , TYPES_URN ) <EOL> description = findtext ( request , '<STR_LIT:description>' , TYPES_URN ) <EOL> value_required = findtext ( request , '<STR_LIT>' , TYPES_URN ) <EOL> display_on_report = findtext ( request , '<STR_LIT>' , TYPES_URN ) <EOL> if name is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if description is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if value_required is None or value_required != '<STR_LIT:false>' : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if display_on_report is None or display_on_report != '<STR_LIT:false>' : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_createTagKey_BADREQUEST ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_SINGLE ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_ALLFILTERS ( self , method , url , body , headers ) : <EOL> ( _ , params ) = url . split ( '<STR_LIT:?>' ) <EOL> parameters = params . split ( '<STR_LIT:&>' ) <EOL> for parameter in parameters : <EOL> ( key , value ) = parameter . split ( '<STR_LIT:=>' ) <EOL> if key == '<STR_LIT:id>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT:name>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT:false>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT:false>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> else : <EOL> raise ValueError ( "<STR_LIT>" . format ( key , value ) ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_d047c609_93d7_4bc5_8fc9_732c85840075 ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tagKey_d047c609_93d7_4bc5_8fc9_732c85840075_NOEXIST ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_editTagKey_NAME ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> name = findtext ( request , '<STR_LIT:name>' , TYPES_URN ) <EOL> description = findtext ( request , '<STR_LIT:description>' , TYPES_URN ) <EOL> value_required = findtext ( request , '<STR_LIT>' , TYPES_URN ) <EOL> display_on_report = findtext ( request , '<STR_LIT>' , TYPES_URN ) <EOL> if name is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if description is not None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if value_required is not None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if display_on_report is not None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_editTagKey_NOTNAME ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> name = findtext ( request , '<STR_LIT:name>' , TYPES_URN ) <EOL> description = findtext ( request , '<STR_LIT:description>' , TYPES_URN ) <EOL> value_required = findtext ( request , '<STR_LIT>' , TYPES_URN ) <EOL> display_on_report = findtext ( request , '<STR_LIT>' , TYPES_URN ) <EOL> if name is not None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if description is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if value_required is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if display_on_report is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_editTagKey_NOCHANGE ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_deleteTagKey ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_deleteTagKey_NOEXIST ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_applyTags ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> asset_type = findtext ( request , '<STR_LIT>' , TYPES_URN ) <EOL> asset_id = findtext ( request , '<STR_LIT>' , TYPES_URN ) <EOL> tag = request . find ( fixxpath ( '<STR_LIT>' , TYPES_URN ) ) <EOL> tag_key_name = findtext ( tag , '<STR_LIT>' , TYPES_URN ) <EOL> value = findtext ( tag , '<STR_LIT:value>' , TYPES_URN ) <EOL> if asset_type is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if asset_id is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if tag_key_name is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if value is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_applyTags_NOVALUE ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> asset_type = findtext ( request , '<STR_LIT>' , TYPES_URN ) <EOL> asset_id = findtext ( request , '<STR_LIT>' , TYPES_URN ) <EOL> tag = request . find ( fixxpath ( '<STR_LIT>' , TYPES_URN ) ) <EOL> tag_key_name = findtext ( tag , '<STR_LIT>' , TYPES_URN ) <EOL> value = findtext ( tag , '<STR_LIT:value>' , TYPES_URN ) <EOL> if asset_type is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if asset_id is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if tag_key_name is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if value is not None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_applyTags_NOTAGKEY ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_removeTags ( self , method , url , body , headers ) : <EOL> request = ET . fromstring ( body ) <EOL> if request . tag != "<STR_LIT>" : <EOL> raise InvalidRequestError ( request . tag ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_removeTags_NOTAG ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . BAD_REQUEST , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tag ( self , method , url , body , headers ) : <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_tag_tag_ALLPARAMS ( self , method , url , body , headers ) : <EOL> ( _ , params ) = url . split ( '<STR_LIT:?>' ) <EOL> parameters = params . split ( '<STR_LIT:&>' ) <EOL> for parameter in parameters : <EOL> ( key , value ) = parameter . split ( '<STR_LIT:=>' ) <EOL> if key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT:false>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT:false>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT:value>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> elif key == '<STR_LIT>' : <EOL> assert value == '<STR_LIT>' <EOL> else : <EOL> raise ValueError ( "<STR_LIT>" . format ( key , value ) ) <EOL> body = self . fixtures . load ( <EOL> '<STR_LIT>' <EOL> ) <EOL> return ( httplib . OK , body , { } , httplib . responses [ httplib . OK ] ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> sys . exit ( unittest . main ( ) ) </s>
