Skip to content

Commit

Permalink
style: ruff reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
bensteUEM committed Jan 7, 2025
1 parent 82bd714 commit 6939f9f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions churchtools_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Module exposure."""

__all__ = ["churchtools_api"]
2 changes: 1 addition & 1 deletion churchtools_api/churchtools_api_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def combine_paginated_response_data(
self,
response_content: dict,
url: str,
**kwargs:dict,
**kwargs: dict,
) -> dict:
"""Helper function which combines data for requests for pagination.
Expand Down
16 changes: 8 additions & 8 deletions churchtools_api/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self) -> None:
"""Inherited initialization."""
super()

def get_groups(self, **kwargs:dict) -> list[dict]:
def get_groups(self, **kwargs: dict) -> list[dict]:
"""Gets list of all groups.
Keywords:
Expand Down Expand Up @@ -61,7 +61,7 @@ def get_groups(self, **kwargs:dict) -> list[dict]:
)
return None

def get_groups_hierarchies(self)->dict:
def get_groups_hierarchies(self) -> dict:
"""Get list of all group hierarchies and convert them to a dict.
Returns:
Expand Down Expand Up @@ -126,7 +126,7 @@ def create_group(
name: str,
group_status_id: int,
grouptype_id: int,
**kwargs:dict,
**kwargs: dict,
) -> dict:
"""Create a new group.
Expand Down Expand Up @@ -244,7 +244,7 @@ def delete_group(self, group_id: int) -> bool:
)
return None

def get_grouptypes(self, **kwargs:dict)->dict:
def get_grouptypes(self, **kwargs: dict) -> dict:
"""Get list of all grouptypes.
Arguments:
Expand Down Expand Up @@ -279,7 +279,7 @@ def get_grouptypes(self, **kwargs:dict)->dict:
)
return None

def get_group_permissions(self, group_id: int)->dict:
def get_group_permissions(self, group_id: int) -> dict:
"""Get permissions of the current user for the given group.
Arguments:
Expand All @@ -306,7 +306,7 @@ def get_group_permissions(self, group_id: int)->dict:
)
return None

def get_group_members(self, group_id: int, **kwargs:dict) -> list[dict]:
def get_group_members(self, group_id: int, **kwargs: dict) -> list[dict]:
"""Get list of members for the given group.
Arguments:
Expand Down Expand Up @@ -350,7 +350,7 @@ def get_groups_members(
group_ids: list[int] | None = None,
*,
with_deleted: bool = False,
**kwargs:dict,
**kwargs: dict,
) -> list[dict]:
"""Access to /groups/members to lookup group memberships.
Expand Down Expand Up @@ -410,7 +410,7 @@ def get_groups_members(
)
return None

def add_group_member(self, group_id: int, person_id: int, **kwargs:dict) -> dict:
def add_group_member(self, group_id: int, person_id: int, **kwargs: dict) -> dict:
"""Add a member to a group.
Arguments:
Expand Down
2 changes: 1 addition & 1 deletion churchtools_api/persons.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self) -> None:
"""Inherited initialization."""
super()

def get_persons(self, **kwargs:dict) -> list[dict]:
def get_persons(self, **kwargs: dict) -> list[dict]:
"""Function to get list of all or a person from CT.
Arguments:
Expand Down
3 changes: 2 additions & 1 deletion generate_pyproj.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""helper to generate pyproject.toml using version.py."""

import importlib.util
from pathlib import Path

Expand Down Expand Up @@ -84,7 +85,7 @@
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`)
# codes by default.
"select": ["ALL"],
"ignore": ["FIX002","COM812", "ISC001"],
"ignore": ["FIX002", "COM812", "ISC001"],
"per-file-ignores": {"tests/*.py": ["S101"]},
# Allow fix for all enabled rules (when `--fix`) is provided.
"fixable": ["ALL"],
Expand Down
1 change: 1 addition & 0 deletions tests/test_churchtools_api_files.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""module test files."""

import json
import logging
import logging.config
Expand Down
2 changes: 1 addition & 1 deletion tests/test_churchtools_api_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_get_group_permissions(self) -> None:
assert permissions["churchdb"]["+see group"] == EXPECTED_NUMNER_OF_PERMISSIONS
assert permissions["churchdb"]["+edit group infos"]

def test_create_and_delete_group(self, caplog:pytest.LogCaptureFixture) -> None:
def test_create_and_delete_group(self, caplog: pytest.LogCaptureFixture) -> None:
"""Checks if groups can be created.
IMPORTANT - This test method and the parameters used depend on target system!
Expand Down
6 changes: 2 additions & 4 deletions tests/test_churchtools_api_posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ def test_get_posts_dates(self) -> None:
]
assert all(FROM_DATE <= date <= TO_DATE for date in result_all_dates)

@pytest.mark.skip(
"issue with CT implementation reported"
)
def test_get_posts_before_last_post(self, caplog:pytest.LogCaptureFixture) -> None:
@pytest.mark.skip("issue with CT implementation reported")
def test_get_posts_before_last_post(self, caplog: pytest.LogCaptureFixture) -> None:
"""Tries to get a all posts using date after filter and last_post_indentifier.
Also tries to request with missing required dependant param
Expand Down

0 comments on commit 6939f9f

Please sign in to comment.