<s> import os <EOL> import sys <EOL> import libcloud . security <EOL> from libcloud . common . types import LibcloudError <EOL> from libcloud . compute . base import NodeAuthPassword , NodeImage , NodeSize <EOL> from libcloud . compute . drivers . azure import AZURE_SERVICE_MANAGEMENT_HOST <EOL> from libcloud . test import unittest <EOL> from libcloud . test import LibcloudTestCase <EOL> from libcloud . test import MockHttp <EOL> from libcloud . test . file_fixtures import ComputeFileFixtures <EOL> from libcloud . utils . py3 import httplib <EOL> from libcloud . compute . base import Node , NodeState <EOL> from libcloud . compute . types import Provider <EOL> from libcloud . compute . providers import get_driver <EOL> class AzureNodeDriverTests ( LibcloudTestCase ) : <EOL> libcloud . security . VERIFY_SSL_CERT = False <EOL> SUBSCRIPTION_ID = '<STR_LIT>' <EOL> KEY_FILE = os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) <EOL> def setUp ( self ) : <EOL> Azure = get_driver ( Provider . AZURE ) <EOL> Azure . connectionCls . conn_classes = ( None , AzureMockHttp ) <EOL> self . driver = Azure ( self . SUBSCRIPTION_ID , self . KEY_FILE ) <EOL> def test_locations_returned_successfully ( self ) : <EOL> locations = self . driver . list_locations ( ) <EOL> self . assertEqual ( len ( locations ) , <NUM_LIT:7> ) <EOL> location_names_result = list ( a . name for a in locations ) <EOL> location_names_expected = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> self . assertListEqual ( location_names_result , location_names_expected ) <EOL> matched_location = next ( <EOL> location for location in locations <EOL> if location . name == '<STR_LIT>' <EOL> ) <EOL> services_result = matched_location . available_services <EOL> services_expected = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> self . assertListEqual ( services_result , services_expected ) <EOL> vm_role_sizes_result = matched_location . virtual_machine_role_sizes <EOL> vm_role_sizes_expected = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> self . assertListEqual ( vm_role_sizes_result , vm_role_sizes_expected ) <EOL> def test_images_returned_successfully ( self ) : <EOL> images = self . driver . list_images ( ) <EOL> self . assertEqual ( len ( images ) , <NUM_LIT> ) <EOL> def test_images_returned_successfully_filter_by_location ( self ) : <EOL> images = self . driver . list_images ( location = "<STR_LIT>" ) <EOL> self . assertEqual ( len ( images ) , <NUM_LIT> ) <EOL> def test_list_nodes_returned_successfully ( self ) : <EOL> vmimages = self . driver . list_nodes ( <EOL> ex_cloud_service_name = "<STR_LIT>" <EOL> ) <EOL> self . assertEqual ( len ( vmimages ) , <NUM_LIT:2> ) <EOL> img0 = vmimages [ <NUM_LIT:0> ] <EOL> self . assertEqual ( img0 . id , "<STR_LIT>" ) <EOL> self . assertEqual ( img0 . name , "<STR_LIT>" ) <EOL> self . assertListEqual ( img0 . public_ips , [ "<STR_LIT>" ] ) <EOL> self . assertListEqual ( img0 . private_ips , [ "<STR_LIT>" ] ) <EOL> self . assertEqual ( img0 . size , None ) <EOL> self . assertEqual ( img0 . state , NodeState . RUNNING ) <EOL> self . assertTrue ( isinstance ( img0 . extra , dict ) ) <EOL> extra = img0 . extra <EOL> self . assertEqual ( extra [ "<STR_LIT>" ] , '<STR_LIT>' ) <EOL> self . assertEqual ( extra [ "<STR_LIT>" ] , '<STR_LIT>' ) <EOL> self . assertEqual ( extra [ "<STR_LIT>" ] , '<STR_LIT>' ) <EOL> def test_list_nodes_returned_no_deployments ( self ) : <EOL> nodes = self . driver . list_nodes ( <EOL> ex_cloud_service_name = "<STR_LIT>" <EOL> ) <EOL> self . assertEqual ( nodes , [ ] ) <EOL> def test_list_nodes_returned_no_cloud_service ( self ) : <EOL> with self . assertRaises ( LibcloudError ) : <EOL> self . driver . list_nodes ( ex_cloud_service_name = "<STR_LIT>" ) <EOL> def test_restart_node_success ( self ) : <EOL> node = Node ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> state = NodeState . RUNNING , <EOL> public_ips = [ ] , <EOL> private_ips = [ ] , <EOL> driver = self . driver <EOL> ) <EOL> result = self . driver . reboot_node ( <EOL> node = node , <EOL> ex_cloud_service_name = "<STR_LIT>" , <EOL> ex_deployment_slot = "<STR_LIT>" <EOL> ) <EOL> self . assertTrue ( result ) <EOL> def test_restart_node_fail_no_deployment ( self ) : <EOL> node = Node ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> state = NodeState . RUNNING , <EOL> public_ips = [ ] , <EOL> private_ips = [ ] , <EOL> driver = self . driver <EOL> ) <EOL> with self . assertRaises ( LibcloudError ) : <EOL> self . driver . reboot_node ( <EOL> node = node , <EOL> ex_cloud_service_name = "<STR_LIT>" , <EOL> ex_deployment_slot = "<STR_LIT>" <EOL> ) <EOL> def test_restart_node_fail_no_cloud_service ( self ) : <EOL> node = Node ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> state = NodeState . RUNNING , <EOL> public_ips = [ ] , <EOL> private_ips = [ ] , <EOL> driver = self . driver <EOL> ) <EOL> with self . assertRaises ( LibcloudError ) : <EOL> self . driver . reboot_node ( <EOL> node = node , <EOL> ex_cloud_service_name = "<STR_LIT>" , <EOL> ex_deployment_slot = "<STR_LIT>" <EOL> ) <EOL> def test_restart_node_fail_node_not_found ( self ) : <EOL> node = Node ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> state = NodeState . RUNNING , <EOL> public_ips = [ ] , <EOL> private_ips = [ ] , <EOL> driver = self . driver <EOL> ) <EOL> result = self . driver . reboot_node ( <EOL> node = node , <EOL> ex_cloud_service_name = "<STR_LIT>" , <EOL> ex_deployment_slot = "<STR_LIT>" <EOL> ) <EOL> self . assertFalse ( result ) <EOL> def test_destroy_node_success_single_node_in_cloud_service ( self ) : <EOL> node = Node ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> state = NodeState . RUNNING , <EOL> public_ips = [ ] , <EOL> private_ips = [ ] , <EOL> driver = self . driver <EOL> ) <EOL> result = self . driver . destroy_node ( <EOL> node = node , <EOL> ex_cloud_service_name = "<STR_LIT>" , <EOL> ex_deployment_slot = "<STR_LIT>" <EOL> ) <EOL> self . assertTrue ( result ) <EOL> def test_destroy_node_success_multiple_nodes_in_cloud_service ( self ) : <EOL> node = Node ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> state = NodeState . RUNNING , <EOL> public_ips = [ ] , <EOL> private_ips = [ ] , <EOL> driver = self . driver <EOL> ) <EOL> result = self . driver . destroy_node ( <EOL> node = node , <EOL> ex_cloud_service_name = "<STR_LIT>" , <EOL> ex_deployment_slot = "<STR_LIT>" <EOL> ) <EOL> self . assertTrue ( result ) <EOL> def test_destroy_node_fail_node_does_not_exist ( self ) : <EOL> node = Node ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> state = NodeState . RUNNING , <EOL> public_ips = [ ] , <EOL> private_ips = [ ] , <EOL> driver = self . driver <EOL> ) <EOL> with self . assertRaises ( LibcloudError ) : <EOL> self . driver . destroy_node ( <EOL> node = node , <EOL> ex_cloud_service_name = "<STR_LIT>" , <EOL> ex_deployment_slot = "<STR_LIT>" <EOL> ) <EOL> def test_destroy_node_success_cloud_service_not_found ( self ) : <EOL> node = Node ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> state = NodeState . RUNNING , <EOL> public_ips = [ ] , <EOL> private_ips = [ ] , <EOL> driver = self . driver <EOL> ) <EOL> with self . assertRaises ( LibcloudError ) : <EOL> self . driver . destroy_node ( <EOL> node = node , <EOL> ex_cloud_service_name = "<STR_LIT>" , <EOL> ex_deployment_slot = "<STR_LIT>" <EOL> ) <EOL> def test_ex_create_cloud_service ( self ) : <EOL> result = self . driver . ex_create_cloud_service ( name = "<STR_LIT>" , location = "<STR_LIT>" ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_create_cloud_service_service_exists ( self ) : <EOL> with self . assertRaises ( LibcloudError ) : <EOL> self . driver . ex_create_cloud_service ( <EOL> name = "<STR_LIT>" , <EOL> location = "<STR_LIT>" <EOL> ) <EOL> def test_ex_destroy_cloud_service ( self ) : <EOL> result = self . driver . ex_destroy_cloud_service ( name = "<STR_LIT>" ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_destroy_cloud_service_service_does_not_exist ( self ) : <EOL> with self . assertRaises ( LibcloudError ) : <EOL> self . driver . ex_destroy_cloud_service ( name = "<STR_LIT>" ) <EOL> def test_ex_create_storage_service ( self ) : <EOL> result = self . driver . ex_create_storage_service ( name = "<STR_LIT>" , location = "<STR_LIT>" ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_create_storage_service_service_exists ( self ) : <EOL> with self . assertRaises ( LibcloudError ) : <EOL> self . driver . ex_create_storage_service ( <EOL> name = "<STR_LIT>" , <EOL> location = "<STR_LIT>" <EOL> ) <EOL> def test_ex_destroy_storage_service ( self ) : <EOL> result = self . driver . ex_destroy_storage_service ( name = "<STR_LIT>" ) <EOL> self . assertTrue ( result ) <EOL> def test_ex_destroy_storage_service_service_does_not_exist ( self ) : <EOL> with self . assertRaises ( LibcloudError ) : <EOL> self . driver . ex_destroy_storage_service ( name = "<STR_LIT>" ) <EOL> def test_create_node_and_deployment_one_node ( self ) : <EOL> kwargs = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> auth = NodeAuthPassword ( "<STR_LIT>" , False ) <EOL> kwargs [ "<STR_LIT>" ] = auth <EOL> kwargs [ "<STR_LIT:name>" ] = "<STR_LIT>" <EOL> kwargs [ "<STR_LIT:size>" ] = NodeSize ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> ram = <NUM_LIT> , <EOL> disk = "<STR_LIT>" , <EOL> bandwidth = <NUM_LIT:0> , <EOL> price = <NUM_LIT:0> , <EOL> driver = self . driver <EOL> ) <EOL> kwargs [ "<STR_LIT:image>" ] = NodeImage ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> driver = self . driver , <EOL> extra = { <EOL> '<STR_LIT>' : False <EOL> } <EOL> ) <EOL> result = self . driver . create_node ( <EOL> ex_cloud_service_name = "<STR_LIT>" , <EOL> ** kwargs <EOL> ) <EOL> self . assertIsNotNone ( result ) <EOL> def test_create_node_and_deployment_second_node ( self ) : <EOL> kwargs = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> auth = NodeAuthPassword ( "<STR_LIT>" , False ) <EOL> kwargs [ "<STR_LIT>" ] = auth <EOL> kwargs [ "<STR_LIT:size>" ] = NodeSize ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> ram = <NUM_LIT> , <EOL> disk = "<STR_LIT>" , <EOL> bandwidth = <NUM_LIT:0> , <EOL> price = <NUM_LIT:0> , <EOL> driver = self . driver <EOL> ) <EOL> kwargs [ "<STR_LIT:image>" ] = NodeImage ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> driver = self . driver , <EOL> extra = { <EOL> '<STR_LIT>' : False <EOL> } <EOL> ) <EOL> kwargs [ "<STR_LIT:name>" ] = "<STR_LIT>" <EOL> result = self . driver . create_node ( <EOL> ex_cloud_service_name = "<STR_LIT>" , <EOL> ** kwargs <EOL> ) <EOL> self . assertIsNotNone ( result ) <EOL> def test_create_node_and_deployment_second_node_307_response ( self ) : <EOL> kwargs = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> auth = NodeAuthPassword ( "<STR_LIT>" , False ) <EOL> kwargs [ "<STR_LIT>" ] = auth <EOL> kwargs [ "<STR_LIT:size>" ] = NodeSize ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> ram = <NUM_LIT> , <EOL> disk = "<STR_LIT>" , <EOL> bandwidth = <NUM_LIT:0> , <EOL> price = <NUM_LIT:0> , <EOL> driver = self . driver <EOL> ) <EOL> kwargs [ "<STR_LIT:image>" ] = NodeImage ( <EOL> id = "<STR_LIT>" , <EOL> name = "<STR_LIT>" , <EOL> driver = self . driver , <EOL> extra = { <EOL> '<STR_LIT>' : False <EOL> } <EOL> ) <EOL> kwargs [ "<STR_LIT:name>" ] = "<STR_LIT>" <EOL> with self . assertRaises ( LibcloudError ) : <EOL> self . driver . create_node ( <EOL> ex_cloud_service_name = "<STR_LIT>" , <EOL> ** kwargs <EOL> ) <EOL> class AzureMockHttp ( MockHttp ) : <EOL> fixtures = ComputeFileFixtures ( '<STR_LIT>' ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz1_deploymentslots_Production ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz1_deployments_dc01 ( self , method , url , body , headers ) : <EOL> return ( httplib . ACCEPTED , body , headers , httplib . responses [ httplib . ACCEPTED ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz2_deploymentslots_Production ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz2_deployments_dc03_roles_oddkinz1 ( self , method , url , body , headers ) : <EOL> return ( httplib . ACCEPTED , body , headers , httplib . responses [ httplib . ACCEPTED ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz2_deployments_dc03_roles_oddkinz2 ( self , method , url , body , headers ) : <EOL> return ( httplib . NOT_FOUND , body , headers , httplib . responses [ httplib . NOT_FOUND ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_oddkinz5_deploymentslots_Production ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . NOT_FOUND , body , headers , httplib . responses [ httplib . NOT_FOUND ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deploymentslots_Production ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deployments_dc03_roleinstances_dc03 ( self , method , url , body , headers ) : <EOL> headers [ "<STR_LIT>" ] = "<STR_LIT>" <EOL> return ( httplib . ACCEPTED , body , headers , httplib . responses [ httplib . ACCEPTED ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest02_deploymentslots_Production ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . NOT_FOUND , body , headers , httplib . responses [ httplib . NOT_FOUND ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest03_deploymentslots_Production ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . NOT_FOUND , body , headers , httplib . responses [ httplib . NOT_FOUND ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01_deployments_dc03_roleinstances_dc13 ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . NOT_FOUND , body , headers , httplib . responses [ httplib . NOT_FOUND ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest01 ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest03 ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_dcoddkinztest04 ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . NOT_FOUND , body , headers , httplib . responses [ httplib . NOT_FOUND ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_images ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_vmimages ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_locations ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices ( self , method , url , body , headers ) : <EOL> if "<STR_LIT>" in body : <EOL> return ( httplib . CREATED , body , headers , httplib . responses [ httplib . CREATED ] ) <EOL> elif "<STR_LIT>" in body : <EOL> return ( httplib . CONFLICT , body , headers , httplib . responses [ httplib . CONFLICT ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdc123 ( self , method , url , body , headers ) : <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_storageservices ( self , method , url , body , headers ) : <EOL> if "<STR_LIT>" in body : <EOL> return ( httplib . ACCEPTED , body , headers , httplib . responses [ httplib . ACCEPTED ] ) <EOL> elif "<STR_LIT>" in body : <EOL> return ( httplib . CONFLICT , body , headers , httplib . responses [ httplib . CONFLICT ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_storageservices_testdss123 ( self , method , url , body , headers ) : <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_storageservices_dss123 ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . NOT_FOUND , body , headers , httplib . responses [ httplib . NOT_FOUND ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdc1234 ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . NOT_FOUND , body , headers , httplib . responses [ httplib . NOT_FOUND ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc_deployments ( self , method , url , body , headers ) : <EOL> headers [ "<STR_LIT>" ] = "<STR_LIT>" <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . ACCEPTED , body , headers , httplib . responses [ httplib . ACCEPTED ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2 ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deploymentslots_Production ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deployments ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc_deployments_dcoddkinztest02_roles ( self , method , url , body , headers ) : <EOL> headers [ "<STR_LIT>" ] = "<STR_LIT>" <EOL> return ( httplib . ACCEPTED , body , headers , httplib . responses [ httplib . ACCEPTED ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc2_deployments_dcoddkinztest02_roles ( self , method , url , body , headers ) : <EOL> headers [ "<STR_LIT>" ] = "<STR_LIT>" <EOL> return ( httplib . ACCEPTED , body , headers , httplib . responses [ httplib . ACCEPTED ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc3 ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc_deploymentslots_Production ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc3_deploymentslots_Production ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc3_deployments ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_services_hostedservices_testdcabc3_deployments_dcoddkinztest02_roles ( self , method , url , body , headers ) : <EOL> redirect_host = "<STR_LIT>" <EOL> if not getattr ( AzureMockHttp , "<STR_LIT>" , False ) : <EOL> setattr ( AzureMockHttp , "<STR_LIT>" , True ) <EOL> headers [ "<STR_LIT>" ] = url . replace ( AZURE_SERVICE_MANAGEMENT_HOST , redirect_host ) <EOL> return ( httplib . TEMPORARY_REDIRECT , None , headers , httplib . responses [ httplib . TEMPORARY_REDIRECT ] ) <EOL> else : <EOL> delattr ( AzureMockHttp , "<STR_LIT>" ) <EOL> if redirect_host not in url : <EOL> if AZURE_SERVICE_MANAGEMENT_HOST in url : <EOL> return ( httplib . TEMPORARY_REDIRECT , None , headers , httplib . responses [ httplib . TEMPORARY_REDIRECT ] ) <EOL> else : <EOL> return ( httplib . REQUEST_TIMEOUT , None , None , httplib . responses [ httplib . REQUEST_TIMEOUT ] ) <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> def _3761b98b_673d_526c_8d55_fee918758e6e_operations_acc33f6756cda6fd96826394fce4c9f3 ( self , method , url , body , headers ) : <EOL> if method == "<STR_LIT:GET>" : <EOL> body = self . fixtures . load ( '<STR_LIT>' ) <EOL> return ( httplib . OK , body , headers , httplib . responses [ httplib . OK ] ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> sys . exit ( unittest . main ( ) ) </s>
