Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
reebalazs committed Mar 1, 2024
1 parent 807c928 commit 6df1520
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 3 additions & 1 deletion tests/services/roles_and_users/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 15 additions & 3 deletions tests/services/roles_and_users/test_roles_and_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 6df1520

Please sign in to comment.