Skip to content

Commit

Permalink
chore: format code with black (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum authored Sep 30, 2023
1 parent a64e838 commit fd259a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
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

0 comments on commit fd259a3

Please sign in to comment.