Skip to content

Commit

Permalink
Updated deletion tag for identity tests (#17665)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsundaralingam authored Mar 31, 2021
1 parent d5c04f0 commit 49e545d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# license information.
# --------------------------------------------------------------------------
import pytest
import datetime
from azure.communication.identity import CommunicationIdentityClient
from azure.communication.identity import CommunicationTokenScope
from azure.core.credentials import AccessToken
Expand Down Expand Up @@ -32,7 +33,7 @@ def setUp(self):
BodyReplacerProcessor(keys=["id", "token"]),
URIIdentityReplacer()])

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
def test_create_user_from_managed_identity(self, connection_string):
endpoint, access_key = parse_connection_str(connection_string)
Expand All @@ -46,7 +47,7 @@ def test_create_user_from_managed_identity(self, connection_string):

assert user.identifier is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
def test_create_user(self, connection_string):
identity_client = CommunicationIdentityClient.from_connection_string(
Expand All @@ -55,7 +56,7 @@ def test_create_user(self, connection_string):

assert user.identifier is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
def test_create_user_and_token(self, connection_string):
identity_client = CommunicationIdentityClient.from_connection_string(connection_string)
Expand All @@ -64,7 +65,7 @@ def test_create_user_and_token(self, connection_string):
assert user.identifier is not None
assert token_response.token is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
def test_get_token_from_managed_identity(self, connection_string):
endpoint, access_key = parse_connection_str(connection_string)
Expand All @@ -81,7 +82,7 @@ def test_get_token_from_managed_identity(self, connection_string):
assert user.identifier is not None
assert token_response.token is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
def test_get_token(self, connection_string):
identity_client = CommunicationIdentityClient.from_connection_string(
Expand All @@ -93,7 +94,7 @@ def test_get_token(self, connection_string):
assert user.identifier is not None
assert token_response.token is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
def test_revoke_tokens_from_managed_identity(self, connection_string):
endpoint, access_key = parse_connection_str(connection_string)
Expand All @@ -111,7 +112,7 @@ def test_revoke_tokens_from_managed_identity(self, connection_string):
assert user.identifier is not None
assert token_response.token is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
def test_revoke_tokens(self, connection_string):
identity_client = CommunicationIdentityClient.from_connection_string(
Expand All @@ -124,7 +125,7 @@ def test_revoke_tokens(self, connection_string):
assert user.identifier is not None
assert token_response.token is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
def test_delete_user_from_managed_identity(self, connection_string):
endpoint, access_key = parse_connection_str(connection_string)
Expand All @@ -140,7 +141,7 @@ def test_delete_user_from_managed_identity(self, connection_string):

assert user.identifier is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
def test_delete_user(self, connection_string):
identity_client = CommunicationIdentityClient.from_connection_string(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# license information.
# --------------------------------------------------------------------------
import pytest
import datetime
from azure.core.credentials import AccessToken
from azure.communication.identity.aio import CommunicationIdentityClient
from azure.communication.identity import CommunicationTokenScope
Expand All @@ -30,7 +31,7 @@ def setUp(self):
BodyReplacerProcessor(keys=["id", "token"]),
URIIdentityReplacer()])

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
async def test_create_user_from_managed_identity(self, connection_string):
endpoint, access_key = parse_connection_str(connection_string)
Expand All @@ -45,7 +46,7 @@ async def test_create_user_from_managed_identity(self, connection_string):

assert user.identifier is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
async def test_create_user(self, connection_string):
identity_client = CommunicationIdentityClient.from_connection_string(connection_string)
Expand All @@ -54,7 +55,7 @@ async def test_create_user(self, connection_string):

assert user.identifier is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
async def test_create_user_and_token(self, connection_string):
identity_client = CommunicationIdentityClient.from_connection_string(connection_string)
Expand All @@ -64,7 +65,7 @@ async def test_create_user_and_token(self, connection_string):
assert user.identifier is not None
assert token_response.token is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
async def test_get_token_from_managed_identity(self, connection_string):
endpoint, access_key = parse_connection_str(connection_string)
Expand All @@ -81,7 +82,7 @@ async def test_get_token_from_managed_identity(self, connection_string):
assert user.identifier is not None
assert token_response.token is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
async def test_get_token(self, connection_string):
identity_client = CommunicationIdentityClient.from_connection_string(connection_string)
Expand All @@ -92,7 +93,7 @@ async def test_get_token(self, connection_string):
assert user.identifier is not None
assert token_response.token is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
async def test_revoke_tokens_from_managed_identity(self, connection_string):
endpoint, access_key = parse_connection_str(connection_string)
Expand All @@ -110,7 +111,7 @@ async def test_revoke_tokens_from_managed_identity(self, connection_string):
assert user.identifier is not None
assert token_response.token is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
async def test_revoke_tokens(self, connection_string):
identity_client = CommunicationIdentityClient.from_connection_string(connection_string)
Expand All @@ -122,7 +123,7 @@ async def test_revoke_tokens(self, connection_string):
assert user.identifier is not None
assert token_response.token is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
async def test_delete_user_from_managed_identity(self, connection_string):
endpoint, access_key = parse_connection_str(connection_string)
Expand All @@ -138,7 +139,7 @@ async def test_delete_user_from_managed_identity(self, connection_string):

assert user.identifier is not None

@ResourceGroupPreparer(random_name_enabled=True)
@ResourceGroupPreparer(random_name_enabled=True, delete_after_tag_timedelta=datetime.timedelta(hours=2))
@CommunicationServicePreparer()
async def test_delete_user(self, connection_string):
identity_client = CommunicationIdentityClient.from_connection_string(connection_string)
Expand Down

0 comments on commit 49e545d

Please sign in to comment.