def test_example_headers_policy():
    url = 'https://bing.com'
    policies = [UserAgentPolicy('myuseragent'), RedirectPolicy()]
    from azure.core.pipeline.policies import HeadersPolicy
    headers_policy = HeadersPolicy()
    headers_policy.add_header('CustomValue', 'Foo')
    policies.append(headers_policy)
    client = PipelineClient(base_url=url, policies=policies)
    request = client.get(url)
    pipeline_response = client._pipeline.run(request, headers={'CustomValue': 'Bar'})
    response = pipeline_response.http_response
    assert (response.status_code == 200)
def test_example_headers_policy():
    url = 'https://bing.com'
    policies = [UserAgentPolicy('myuseragent'), RedirectPolicy()]
    from azure.core.pipeline.policies import HeadersPolicy
    headers_policy = HeadersPolicy()
    headers_policy.add_header('CustomValue', 'Foo')
    policies.append(headers_policy)
    client = PipelineClient(base_url=url, policies=policies)
    request = client.get(url)
    pipeline_response = client._pipeline.run(request, headers={'CustomValue': 'Bar'})
    response = pipeline_response.http_response
    assert (response.status_code == 200)