Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: format code with black #18

Merged
merged 2 commits into from
Sep 30, 2023
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
1 change: 1 addition & 0 deletions dsp_permissions_scripts/models/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class PermissionScope(BaseModel):
A scope is an object encoding the information:
"Which user group gets which permissions on a resource/value?"
"""

CR: list[str | BuiltinGroup] = []
D: list[str | BuiltinGroup] = []
M: list[str | BuiltinGroup] = []
Expand Down
22 changes: 11 additions & 11 deletions tests/test_scope_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ class TestScopeSerialization(unittest.TestCase):
]
scopes = [
PermissionScope(
CR=[BuiltinGroup.SYSTEM_USER],
V=["http://www.knora.org/ontology/knora-admin#CustomGroup"]
CR=[BuiltinGroup.SYSTEM_USER],
V=["http://www.knora.org/ontology/knora-admin#CustomGroup"],
),
PermissionScope(
D=[BuiltinGroup.PROJECT_ADMIN],
RV=[BuiltinGroup.PROJECT_MEMBER]
D=[BuiltinGroup.PROJECT_ADMIN],
RV=[BuiltinGroup.PROJECT_MEMBER],
),
PermissionScope(
M=[BuiltinGroup.PROJECT_ADMIN],
V=[BuiltinGroup.CREATOR, BuiltinGroup.KNOWN_USER],
RV=[BuiltinGroup.UNKNOWN_USER]
M=[BuiltinGroup.PROJECT_ADMIN],
V=[BuiltinGroup.CREATOR, BuiltinGroup.KNOWN_USER],
RV=[BuiltinGroup.UNKNOWN_USER],
),
PermissionScope(
CR=[BuiltinGroup.SYSTEM_ADMIN, BuiltinGroup.PROJECT_ADMIN],
D=[BuiltinGroup.CREATOR],
RV=[BuiltinGroup.UNKNOWN_USER]
CR=[BuiltinGroup.SYSTEM_ADMIN, BuiltinGroup.PROJECT_ADMIN],
D=[BuiltinGroup.CREATOR],
RV=[BuiltinGroup.UNKNOWN_USER],
),
]

Expand All @@ -67,7 +67,7 @@ def test_create_scope_from_string(self) -> None:
scope.model_dump_json(),
msg=f"Failed with permission string '{perm_string}'",
)

def test_create_scope_from_admin_route_object(self) -> None:
for admin_route_object, scope, index in zip(self.admin_route_objects, self.scopes, range(len(self.scopes))):
self.assertEqual(
Expand Down