def test_example_user_agent_policy():
    url = 'https://bing.com'
    redirect_policy = RedirectPolicy()
    from azure.core.pipeline.policies import UserAgentPolicy
    user_agent_policy = UserAgentPolicy()
    user_agent_policy.add_user_agent('CustomValue')
    policies = [redirect_policy, user_agent_policy]
    client = PipelineClient(base_url=url, policies=policies)
    request = client.get(url)
    pipeline_response = client._pipeline.run(request, user_agent='AnotherValue')
    response = pipeline_response.http_response
    assert (response.status_code == 200)
def test_example_user_agent_policy():
    url = 'https://bing.com'
    redirect_policy = RedirectPolicy()
    from azure.core.pipeline.policies import UserAgentPolicy
    user_agent_policy = UserAgentPolicy()
    user_agent_policy.add_user_agent('CustomValue')
    policies = [redirect_policy, user_agent_policy]
    client = PipelineClient(base_url=url, policies=policies)
    request = client.get(url)
    pipeline_response = client._pipeline.run(request, user_agent='AnotherValue')
    response = pipeline_response.http_response
    assert (response.status_code == 200)