Skip to content

Commit

Permalink
fix(#12): corrected testing automation and references
Browse files Browse the repository at this point in the history
  • Loading branch information
bensteUEM committed Jan 13, 2025
1 parent c997cd1 commit 9586db7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-unittest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python Unittest CommuniAPI
name: Python Tests CommuniAPI

on: [ push, pull_request ]

Expand Down Expand Up @@ -45,6 +45,6 @@ jobs:

- name: Run unittests
run: |
python -m unittest tests.test_communi_api
pytest tests/*
env:
POETRY_HOME: ${{ github.workspace }}/.poetry
2 changes: 1 addition & 1 deletion communi_api/churchToolsActions.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def generate_services_for_event(ct_api, eventId):
event = ct_api.get_events(eventId=eventId, include="eventServices")[0]
service_names = ct_api.get_services(returnAsDict=True)

serviceGroups = ct_api.get_event_masterdata(type="serviceGroups", returnAsDict=True)
serviceGroups = ct_api.get_event_masterdata(resultClass="serviceGroups", returnAsDict=True)
eventServices = {item["name"]: {} for item in serviceGroups.values()}

for service in event["eventServices"]:
Expand Down
4 changes: 3 additions & 1 deletion tests/test_communi_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
logging.config.dictConfig(config=logging_config)


class TestsCommuniApp(unittest.TestCase):
class TestsCommuniApp():
def setup_class(self) -> None:
"""Common setup with testing provides api connections."""
if "COMMUNI_TOKEN" in os.environ:
self.COMMUNI_TOKEN = os.environ["COMMUNI_TOKEN"]
self.COMMUNI_SERVER = os.environ["COMMUNI_SERVER"]
Expand Down Expand Up @@ -52,6 +53,7 @@ def setup_class(self) -> None:
def tearDown(self) -> None:
"""Destroy the session after test execution to avoid resource issues."""
self.api.session.close()
logger.debug("Finished Tests RUN")

def test_config(self) -> None:
"""Check that configuration exists."""
Expand Down

0 comments on commit 9586db7

Please sign in to comment.