From 6df15200fe75775c9e53ae7c2f19a9b33886581f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Re=C3=A9?= Date: Fri, 1 Mar 2024 10:03:10 +0100 Subject: [PATCH] fix linting --- tests/services/roles_and_users/conftest.py | 4 +++- .../roles_and_users/test_roles_and_users.py | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/services/roles_and_users/conftest.py b/tests/services/roles_and_users/conftest.py index 7d67a24..19e69b4 100644 --- a/tests/services/roles_and_users/conftest.py +++ b/tests/services/roles_and_users/conftest.py @@ -53,7 +53,9 @@ def users(user_credentials, member_as_user1_credentials) -> List: @pytest.fixture -def users_credentials_role(user_credentials, member_as_user1_credentials) -> dict: +def users_credentials_role( + user_credentials, member_as_user1_credentials +) -> dict: return { "manager": (SITE_OWNER_NAME, SITE_OWNER_PASSWORD), "member": user_credentials, diff --git a/tests/services/roles_and_users/test_roles_and_users.py b/tests/services/roles_and_users/test_roles_and_users.py index c3e2935..6153355 100644 --- a/tests/services/roles_and_users/test_roles_and_users.py +++ b/tests/services/roles_and_users/test_roles_and_users.py @@ -16,7 +16,9 @@ class TestEndpointRolesAndUsers: url = "/@solr?q=chomsky" @pytest.fixture - def api_request(self, request_factory, users_credentials_role, portal, roles): + def api_request( + self, request_factory, users_credentials_role, portal, roles + ): def func(role: str) -> dict: req = request_factory() credentials = users_credentials_role.get(role, None) @@ -39,12 +41,22 @@ class TestEndpointRolesAndUsersNoPermission(TestEndpointRolesAndUsers): "role,roles,path,expected", [ ("anonymous", ["Anonymous"], "/plone/document2", False), - ("member_as_user1", ["user:test_user_1_"], "/plone/document2", True), + ( + "member_as_user1", + ["user:test_user_1_"], + "/plone/document2", + True, + ), ("member_as_user1", ["Reader"], "/plone/document2", True), ], ) def test_paths( - self, api_request, all_path_string, role: str, path: str, expected: bool + self, + api_request, + all_path_string, + role: str, + path: str, + expected: bool, ): data = api_request(role).get(self.url).json() path_strings = all_path_string(data)