diff --git a/requirements.txt b/requirements.txt index 11e7b771e..b70a8018f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,5 +16,5 @@ pytest-asyncio pytest-mock pytest-recording pyfakefs -aenum==3.1.11 +aenum pydash diff --git a/tests/integration/test_org_it.py b/tests/integration/test_org_it.py index 23c46b85c..c8882176e 100644 --- a/tests/integration/test_org_it.py +++ b/tests/integration/test_org_it.py @@ -81,7 +81,7 @@ async def test_get_org_contact_types(self, fs): @pytest.mark.asyncio async def test_get_org_contact_user(self, fs): client = MockOktaClient(fs) - contact_type = OrgContactType('BILLING') + contact_type = OrgContactType.BILLING.value org_contact_user, _, err = await client.get_org_contact_user(contact_type) assert err is None assert isinstance(org_contact_user, OrgContactUser) @@ -91,11 +91,11 @@ async def test_get_org_contact_user(self, fs): @pytest.mark.asyncio async def test_update_org_contact_user(self, fs): client = MockOktaClient(fs) - contact_type = OrgContactType('BILLING') + contact_type = OrgContactType.BILLING.value org_contact_user, _, err = await client.get_org_contact_user(contact_type) assert err is None - new_contact_type = OrgContactType('TECHNICAL') + new_contact_type = OrgContactType.TECHNICAL.value try: updated_user, _, err = await client.update_org_contact_user(new_contact_type, UserIdString({'userId': org_contact_user.user_id})) diff --git a/tests/integration/test_subscription_it.py b/tests/integration/test_subscription_it.py index f9340765c..370e89636 100644 --- a/tests/integration/test_subscription_it.py +++ b/tests/integration/test_subscription_it.py @@ -26,23 +26,23 @@ async def test_list_role_subsription(self, fs): async def test_get_role_subscription_by_notification_type(self, fs): # Instantiate Mock Client client = MockOktaClient(fs) - notification_type = models.NotificationType('OKTA_ISSUE') + notification_type = models.NotificationType.OKTA_ISSUE.value resp, _, err = await client.get_role_subscription_by_notification_type('SUPER_ADMIN', notification_type) assert isinstance(resp, models.Subscription) - assert resp.notification_type == models.NotificationType('OKTA_ISSUE') + assert resp.notification_type == models.NotificationType.OKTA_ISSUE.value @pytest.mark.vcr() @pytest.mark.asyncio async def test_subscribe_unsubscribe_role_by_notification_type(self, fs): # Instantiate Mock Client client = MockOktaClient(fs) - notification_type = models.NotificationType('OKTA_ISSUE') + notification_type = models.NotificationType.OKTA_ISSUE.value _, err = await client.subscribe_role_subscription_by_notification_type('SUPER_ADMIN', notification_type) assert err is None resp, _, err = await client.get_role_subscription_by_notification_type('SUPER_ADMIN', notification_type) assert isinstance(resp, models.Subscription) - assert resp.notification_type == models.NotificationType('OKTA_ISSUE') + assert resp.notification_type == models.NotificationType.OKTA_ISSUE.value assert resp.status == models.SubscriptionStatus('SUBSCRIBED') try: @@ -50,7 +50,7 @@ async def test_subscribe_unsubscribe_role_by_notification_type(self, fs): assert err is None resp, _, err = await client.get_role_subscription_by_notification_type('SUPER_ADMIN', notification_type) assert isinstance(resp, models.Subscription) - assert resp.notification_type == models.NotificationType('OKTA_ISSUE') + assert resp.notification_type == models.NotificationType.OKTA_ISSUE.value assert resp.status == models.SubscriptionStatus('UNSUBSCRIBED') finally: @@ -68,17 +68,17 @@ async def test_subscribe_unsubscribe_user(self, fs): assert err is None user = users[0] - notification_type = models.NotificationType('OKTA_ISSUE') + notification_type = models.NotificationType.OKTA_ISSUE.value _, err = await client.subscribe_user_subscription_by_notification_type(user.id, notification_type) assert err is None resp, _, err = await client.get_user_subscription_by_notification_type(user.id, notification_type) - assert resp.notification_type == models.NotificationType('OKTA_ISSUE') + assert resp.notification_type == models.NotificationType.OKTA_ISSUE.value assert resp.status == models.SubscriptionStatus('SUBSCRIBED') _, err = await client.unsubscribe_user_subscription_by_notification_type(user.id, notification_type) assert err is None resp, _, err = await client.get_user_subscription_by_notification_type(user.id, notification_type) - assert resp.notification_type == models.NotificationType('OKTA_ISSUE') + assert resp.notification_type == models.NotificationType.OKTA_ISSUE.value assert resp.status == models.SubscriptionStatus('UNSUBSCRIBED')