From 1ee77f723492ab41b284129578adb1d5dbcc13c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?McCoy=20Pati=C3=B1o?= Date: Wed, 24 Feb 2021 17:58:54 -0800 Subject: [PATCH] wip; Add tests --- .../azure-keyvault-keys/tests/test_crypto_client.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sdk/keyvault/azure-keyvault-keys/tests/test_crypto_client.py b/sdk/keyvault/azure-keyvault-keys/tests/test_crypto_client.py index 2466cb244bda..37af9c88e013 100644 --- a/sdk/keyvault/azure-keyvault-keys/tests/test_crypto_client.py +++ b/sdk/keyvault/azure-keyvault-keys/tests/test_crypto_client.py @@ -491,6 +491,15 @@ def test_calls_service_for_operations_unsupported_locally(): assert supports_nothing.wrap_key.call_count == 0 +def test_local_only_mode_no_service_calls(): + """With a local-only CryptographyClient, it shouldn't call the service if an operation can't be performed locally""" + + mock_client = mock.Mock() + jwk = mock.Mock(spec=JsonWebKey) + client = CryptographyClient.from_jkw(key_id="https://localhost/fake/key/version", jwk=jwk) + client._client = mock_client + + def test_prefers_local_provider(): """The client should complete operations locally whenever possible"""