Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
v-xuto committed Nov 19, 2021
1 parent 9940f80 commit 185b5e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions sdk/keyvault/azure-keyvault-keys/tests/_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def suffixed_test_name(testcase_func, param_num, param):
)


def is_public_cloud():
return (".microsoftonline.com" in os.environ["AZURE_AUTHORITY_HOST"])


class KeysTestCase(AzureTestCase):
def setUp(self, *args, **kwargs):
vault_playback_url = "https://vaultname.vault.azure.net"
Expand Down
6 changes: 3 additions & 3 deletions sdk/keyvault/azure-keyvault-keys/tests/test_key_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from six import byte2int

from _shared.test_case import KeyVaultTestCase
from _test_case import client_setup, get_attestation_token, get_decorator, get_release_policy, KeysTestCase
from _test_case import client_setup, get_attestation_token, get_decorator, get_release_policy, is_public_cloud, KeysTestCase


all_api_versions = get_decorator()
Expand Down Expand Up @@ -560,7 +560,7 @@ def test_update_release_policy(self, client, **kwargs):
@only_vault_7_3_preview()
@client_setup
def test_key_rotation(self, client, **kwargs):
if (not ".microsoftonline.com" in os.environ["AZURE_AUTHORITY_HOST"] and self.is_live):
if (not is_public_cloud() and self.is_live):
pytest.skip("This test not supprot in usgov/china region. Follow up with service team.")

key_name = self.get_resource_name("rotation-key")
Expand All @@ -575,7 +575,7 @@ def test_key_rotation(self, client, **kwargs):
@only_vault_7_3_preview()
@client_setup
def test_key_rotation_policy(self, client, **kwargs):
if (not ".microsoftonline.com" in os.environ["AZURE_AUTHORITY_HOST"] and self.is_live):
if (not is_public_cloud() and self.is_live):
pytest.skip("This test not supprot in usgov/china region. Follow up with service team.")

key_name = self.get_resource_name("rotation-key")
Expand Down
6 changes: 3 additions & 3 deletions sdk/keyvault/azure-keyvault-keys/tests/test_keys_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from six import byte2int

from _shared.test_case_async import KeyVaultTestCase
from _test_case import client_setup, get_attestation_token, get_decorator, get_release_policy, KeysTestCase
from _test_case import client_setup, get_attestation_token, get_decorator, get_release_policy, is_public_cloud, KeysTestCase
from test_key_client import _assert_lifetime_actions_equal, _assert_rotation_policies_equal


Expand Down Expand Up @@ -557,7 +557,7 @@ async def test_update_release_policy(self, client, **kwargs):
@only_vault_7_3_preview()
@client_setup
async def test_key_rotation(self, client, **kwargs):
if (not ".microsoftonline.com" in os.environ["AZURE_AUTHORITY_HOST"] and self.is_live):
if (not is_public_cloud() and self.is_live):
pytest.skip("This test not supprot in usgov/china region. Follow up with service team.")

key_name = self.get_resource_name("rotation-key")
Expand All @@ -572,7 +572,7 @@ async def test_key_rotation(self, client, **kwargs):
@only_vault_7_3_preview()
@client_setup
async def test_key_rotation_policy(self, client, **kwargs):
if (not ".microsoftonline.com" in os.environ["AZURE_AUTHORITY_HOST"] and self.is_live):
if (not is_public_cloud() and self.is_live):
pytest.skip("This test not supprot in usgov/china region. Follow up with service team.")

key_name = self.get_resource_name("rotation-key")
Expand Down

0 comments on commit 185b5e0

Please sign in to comment.