@ResourceGroupPreparer(location=WINDOWS_ASP_LOCATION_WEBAPP)
def test_traffic_routing(self, resource_group):
    plan = self.create_random_name(prefix='slot-traffic-plan', length=24)
    webapp = self.create_random_name(prefix='slot-traffic-web', length=24)
    plan_result = self.cmd('appservice plan create -g {} -n {} --sku S1'.format(resource_group, plan)).get_output_in_json()
    self.cmd('webapp create -g {} -n {} --plan {}'.format(resource_group, webapp, plan_result['name']))
    slot = 'staging'
    self.cmd('webapp deployment slot create -g {} -n {} --slot {}'.format(resource_group, webapp, slot))
    self.cmd('webapp traffic-routing set -g {} -n {} -d {}=15'.format(resource_group, webapp, slot), checks=[JMESPathCheck('[0].actionHostName', (((webapp + '-') + slot) + '.azurewebsites.net')), JMESPathCheck('[0].reroutePercentage', 15.0)])
    self.cmd('webapp traffic-routing show -g {} -n {}'.format(resource_group, webapp), checks=[JMESPathCheck('[0].actionHostName', (((webapp + '-') + slot) + '.azurewebsites.net')), JMESPathCheck('[0].reroutePercentage', 15.0)])
    self.cmd('webapp traffic-routing clear -g {} -n {}'.format(resource_group, webapp))
@ResourceGroupPreparer(location=WINDOWS_ASP_LOCATION_WEBAPP)
def test_traffic_routing(self, resource_group):
    plan = self.create_random_name(prefix='slot-traffic-plan', length=24)
    webapp = self.create_random_name(prefix='slot-traffic-web', length=24)
    plan_result = self.cmd('appservice plan create -g {} -n {} --sku S1'.format(resource_group, plan)).get_output_in_json()
    self.cmd('webapp create -g {} -n {} --plan {}'.format(resource_group, webapp, plan_result['name']))
    slot = 'staging'
    self.cmd('webapp deployment slot create -g {} -n {} --slot {}'.format(resource_group, webapp, slot))
    self.cmd('webapp traffic-routing set -g {} -n {} -d {}=15'.format(resource_group, webapp, slot), checks=[JMESPathCheck('[0].actionHostName', (((webapp + '-') + slot) + '.azurewebsites.net')), JMESPathCheck('[0].reroutePercentage', 15.0)])
    self.cmd('webapp traffic-routing show -g {} -n {}'.format(resource_group, webapp), checks=[JMESPathCheck('[0].actionHostName', (((webapp + '-') + slot) + '.azurewebsites.net')), JMESPathCheck('[0].reroutePercentage', 15.0)])
    self.cmd('webapp traffic-routing clear -g {} -n {}'.format(resource_group, webapp))