Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom hook policy test classes subclass SansIOHTTPPolicy #16784

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pytest

from azure.core.exceptions import ResourceExistsError
from azure.core.pipeline.policies import SansIOHTTPPolicy
from azure_devtools.scenario_tests import RecordingProcessor, RequestUrlNormalizer

from azure.keyvault.certificates import (
Expand Down Expand Up @@ -698,7 +699,7 @@ def test_service_headers_allowed_in_logs():


def test_custom_hook_policy():
class CustomHookPolicy(object):
class CustomHookPolicy(SansIOHTTPPolicy):
pass

client = CertificateClient("...", object(), custom_hook_policy=CustomHookPolicy())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import json

from azure.core.exceptions import ResourceExistsError
from azure.core.pipeline.policies import SansIOHTTPPolicy
from azure_devtools.scenario_tests import RecordingProcessor
from azure.keyvault.certificates import (
AdministratorContact,
Expand Down Expand Up @@ -708,7 +709,7 @@ def test_service_headers_allowed_in_logs():


def test_custom_hook_policy():
class CustomHookPolicy(object):
class CustomHookPolicy(SansIOHTTPPolicy):
pass

client = CertificateClient("...", object(), custom_hook_policy=CustomHookPolicy())
Expand Down
3 changes: 2 additions & 1 deletion sdk/keyvault/azure-keyvault-keys/tests/test_crypto_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import mock

from azure.core.exceptions import HttpResponseError
from azure.core.pipeline.policies import SansIOHTTPPolicy
from azure.keyvault.keys import JsonWebKey, KeyClient, KeyCurveName, KeyType, KeyVaultKey
from azure.keyvault.keys.crypto import CryptographyClient, EncryptionAlgorithm, KeyWrapAlgorithm, SignatureAlgorithm
from azure.keyvault.keys.crypto._key_validity import _UTC
Expand Down Expand Up @@ -382,7 +383,7 @@ def test_operations(key, expected_error_substrings, encrypt_algorithms, wrap_alg


def test_custom_hook_policy():
class CustomHookPolicy(object):
class CustomHookPolicy(SansIOHTTPPolicy):
pass

client = CryptographyClient("https://localhost/fake/key/version", object(), custom_hook_policy=CustomHookPolicy())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from unittest import mock

from azure.core.exceptions import HttpResponseError
from azure.core.pipeline.policies import SansIOHTTPPolicy
from azure.keyvault.keys import JsonWebKey, KeyCurveName, KeyVaultKey
from azure.keyvault.keys.aio import KeyClient
from azure.keyvault.keys.crypto._key_validity import _UTC
Expand Down Expand Up @@ -379,7 +380,7 @@ async def test_operations(key, expected_error_substrings, encrypt_algorithms, wr


def test_custom_hook_policy():
class CustomHookPolicy(object):
class CustomHookPolicy(SansIOHTTPPolicy):
pass

client = CryptographyClient("https://localhost/fake/key/version", object(), custom_hook_policy=CustomHookPolicy())
Expand Down
3 changes: 2 additions & 1 deletion sdk/keyvault/azure-keyvault-keys/tests/test_key_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import json

from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError
from azure.core.pipeline.policies import SansIOHTTPPolicy
from azure.keyvault.keys import JsonWebKey, KeyClient
from azure.keyvault.keys._shared import HttpChallengeCache
from devtools_testutils import PowerShellPreparer
Expand Down Expand Up @@ -416,7 +417,7 @@ def test_service_headers_allowed_in_logs():


def test_custom_hook_policy():
class CustomHookPolicy(object):
class CustomHookPolicy(SansIOHTTPPolicy):
pass

client = KeyClient("...", object(), custom_hook_policy=CustomHookPolicy())
Expand Down
3 changes: 2 additions & 1 deletion sdk/keyvault/azure-keyvault-keys/tests/test_keys_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from dateutil import parser as date_parse

from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError
from azure.core.pipeline.policies import SansIOHTTPPolicy
from azure.keyvault.keys import JsonWebKey
from azure.keyvault.keys.aio import KeyClient
from azure.keyvault.keys._shared import HttpChallengeCache
Expand Down Expand Up @@ -441,7 +442,7 @@ def test_service_headers_allowed_in_logs():


def test_custom_hook_policy():
class CustomHookPolicy(object):
class CustomHookPolicy(SansIOHTTPPolicy):
pass

client = KeyClient("...", object(), custom_hook_policy=CustomHookPolicy())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import json

from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError
from azure.core.pipeline.policies import SansIOHTTPPolicy
from azure.keyvault.secrets.aio import SecretClient
from devtools_testutils import ResourceGroupPreparer, KeyVaultPreparer

Expand Down Expand Up @@ -334,7 +335,7 @@ def test_service_headers_allowed_in_logs():


def test_custom_hook_policy():
class CustomHookPolicy(object):
class CustomHookPolicy(SansIOHTTPPolicy):
pass

client = SecretClient("...", object(), custom_hook_policy=CustomHookPolicy())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import json

from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError
from azure.core.pipeline.policies import SansIOHTTPPolicy
from azure.keyvault.secrets import SecretClient
from devtools_testutils import ResourceGroupPreparer, KeyVaultPreparer

Expand Down Expand Up @@ -341,7 +342,7 @@ def test_service_headers_allowed_in_logs():


def test_custom_hook_policy():
class CustomHookPolicy(object):
class CustomHookPolicy(SansIOHTTPPolicy):
pass

client = SecretClient("...", object(), custom_hook_policy=CustomHookPolicy())
Expand Down