Skip to content

Commit 2470e92

Browse files
committed
test you can pass custom hook policy to client
1 parent 18ab6e8 commit 2470e92

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

sdk/keyvault/azure-keyvault-secrets/tests/test_secrets_async.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,12 @@ async def test_allowed_headers_passed_to_http_logging_policy(self, client, **kwa
335335
assert passed_in_allowed_headers.issubset(
336336
client._client._config.http_logging_policy.allowed_header_names
337337
)
338+
339+
class _CustomHookPolicy(object):
340+
pass
341+
342+
@ResourceGroupPreparer(random_name_enabled=True)
343+
@KeyVaultPreparer()
344+
@KeyVaultClientPreparer(client_kwargs={"custom_hook_policy": _CustomHookPolicy()})
345+
async def test_custom_hook_policy(self, client, **kwargs):
346+
assert isinstance(client._client._config.custom_hook_policy, KeyVaultSecretTest._CustomHookPolicy)

sdk/keyvault/azure-keyvault-secrets/tests/test_secrets_client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,3 +341,12 @@ def test_allowed_headers_passed_to_http_logging_policy(self, client, **kwargs):
341341
assert passed_in_allowed_headers.issubset(
342342
client._client._config.http_logging_policy.allowed_header_names
343343
)
344+
345+
class _CustomHookPolicy(object):
346+
pass
347+
348+
@ResourceGroupPreparer(random_name_enabled=True)
349+
@KeyVaultPreparer()
350+
@KeyVaultClientPreparer(client_kwargs={"custom_hook_policy": _CustomHookPolicy()})
351+
def test_custom_hook_policy(self, client, **kwargs):
352+
assert isinstance(client._client._config.custom_hook_policy, SecretClientTests._CustomHookPolicy)

0 commit comments

Comments
 (0)