Skip to content

Commit

Permalink
fix ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Apr 16, 2024
1 parent f0e23ae commit 49d1e44
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dsp_permissions_scripts/oap/oap_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _get_values_to_update(resource: dict[str, Any]) -> list[ValueUpdate]:
return res


def _update_permissions_for_value(
def _update_permissions_for_value( # noqa: PLR0913
resource_iri: str,
value: ValueUpdate,
resource_type: str,
Expand Down Expand Up @@ -65,7 +65,7 @@ def _update_permissions_for_value(
logger.info(f"Updated permissions of resource {resource_iri}, value {value.value_iri}")


def _update_permissions_for_resource(
def _update_permissions_for_resource( # noqa: PLR0913
resource_iri: str,
lmd: str | None,
resource_type: str,
Expand Down
2 changes: 2 additions & 0 deletions dsp_permissions_scripts/utils/dsp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from dsp_permissions_scripts.utils.get_logger import get_logger
from dsp_permissions_scripts.utils.helpers import PACKAGE_NAME

# ruff: noqa: PLR2004 (magic value used in comparison)

logger = get_logger(__name__)

HTTP_OK = 200
Expand Down
12 changes: 6 additions & 6 deletions tests/test_scope_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ def compare_scopes(


class TestScopeSerialization(unittest.TestCase):
perm_strings = [
perm_strings = (
"CR knora-admin:SystemAdmin|V knora-admin:CustomGroup",
"D knora-admin:ProjectAdmin|RV knora-admin:ProjectMember",
"M knora-admin:ProjectAdmin|V knora-admin:Creator,knora-admin:KnownUser|RV knora-admin:UnknownUser",
"CR knora-admin:SystemAdmin,knora-admin:ProjectAdmin|D knora-admin:Creator|RV knora-admin:UnknownUser",
]
admin_route_objects = [
)
admin_route_objects = (
[
{"name": "CR", "additionalInformation": "knora-admin:SystemAdmin", "permissionCode": None},
{"name": "V", "additionalInformation": "knora-admin:CustomGroup", "permissionCode": None},
Expand All @@ -51,8 +51,8 @@ class TestScopeSerialization(unittest.TestCase):
{"name": "D", "additionalInformation": "knora-admin:Creator", "permissionCode": None},
{"name": "RV", "additionalInformation": "knora-admin:UnknownUser", "permissionCode": None},
],
]
scopes = [
)
scopes = (
PermissionScope.create(
CR=[group.SYSTEM_ADMIN],
V=[group.Group(val="http://www.knora.org/ontology/knora-admin#CustomGroup")],
Expand All @@ -71,7 +71,7 @@ class TestScopeSerialization(unittest.TestCase):
D={group.CREATOR},
RV={group.UNKNOWN_USER},
),
]
)

def test_create_scope_from_string(self) -> None:
for perm_string, scope in zip(self.perm_strings, self.scopes):
Expand Down

0 comments on commit 49d1e44

Please sign in to comment.