Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ pytest-asyncio
pytest-mock
pytest-recording
pyfakefs
aenum==3.1.11
aenum
pydash
6 changes: 3 additions & 3 deletions tests/integration/test_org_it.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}))
Expand Down
16 changes: 8 additions & 8 deletions tests/integration/test_subscription_it.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,31 @@ 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:
_, err = await client.unsubscribe_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('UNSUBSCRIBED')

finally:
Expand All @@ -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')