Skip to content

Commit

Permalink
Update test_content_item_permissions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke committed Dec 5, 2024
1 parent ab5a4d5 commit 8bcbdb7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions integration/tests/posit/connect/test_content_item_permissions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
from __future__ import annotations

from typing import TYPE_CHECKING

import pytest

from posit import connect
from posit.connect.content import ContentItem

if TYPE_CHECKING:
from posit.connect.content import ContentItem
from posit.connect.permissions import Permission


class TestContentPermissions:
Expand Down Expand Up @@ -50,7 +57,7 @@ def test_permissions_add_destroy(self):
role="owner",
)

def assert_permissions_match_guids(permissions, objs_with_guid):
def assert_permissions_match_guids(permissions: list[Permission], objs_with_guid):
for permission, obj_with_guid in zip(permissions, objs_with_guid):
assert permission["principal_guid"] == obj_with_guid["guid"]

Expand All @@ -72,11 +79,7 @@ def assert_permissions_match_guids(permissions, objs_with_guid):
)

# Remove the last permission
destroyed_permissions = self.content.permissions.destroy(self.group_friends)
assert_permissions_match_guids(
destroyed_permissions,
[self.group_friends],
)
self.content.permissions.destroy(self.group_friends)

# Prove they have been removed
assert self.content.permissions.find() == []

0 comments on commit 8bcbdb7

Please sign in to comment.