From 442a60c09d1febc44f6f35b8478dc9e884f80b7d Mon Sep 17 00:00:00 2001 From: nazarfil Date: Thu, 10 Oct 2024 15:16:15 +0200 Subject: [PATCH] chore: update formatting --- openhexa/toolbox/iaso/iaso.py | 2 +- tests/iaso/test_iaso.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/openhexa/toolbox/iaso/iaso.py b/openhexa/toolbox/iaso/iaso.py index 99b8b10..196d783 100644 --- a/openhexa/toolbox/iaso/iaso.py +++ b/openhexa/toolbox/iaso/iaso.py @@ -63,7 +63,7 @@ def get_org_units(self, page: int = 1, limit: int = 10, **kwargs) -> dict: return json_response.get("orgunits") elif "orgUnits" in json_response: return json_response.get("orgUnits") - return [] + return {} def get_form_instances( self, diff --git a/tests/iaso/test_iaso.py b/tests/iaso/test_iaso.py index d37b41c..7824a45 100644 --- a/tests/iaso/test_iaso.py +++ b/tests/iaso/test_iaso.py @@ -9,7 +9,8 @@ iaso_mocked_orgunits, iaso_mocked_refreshed_auth_token, iaso_mocked_projects, - iaso_mocked_instances, iaso_mocked_orgunits_with_params, + iaso_mocked_instances, + iaso_mocked_orgunits_with_params, ) @@ -50,16 +51,21 @@ def test_get_org_units(self, mock_responses): iaso = IASO("https://iaso-staging.bluesquare.org", "username", "password") r = iaso.get_org_units() assert len(r) > 0 + def test_get_org_units_with_params(self, mock_responses): mock_responses.add( responses.POST, "https://iaso-staging.bluesquare.org/api/token/", json=iaso_mocked_auth_token, status=200 ) mock_responses.add( - responses.GET, "https://iaso-staging.bluesquare.org/api/orgunits/", json=iaso_mocked_orgunits_with_params, status=200 + responses.GET, + "https://iaso-staging.bluesquare.org/api/orgunits/", + json=iaso_mocked_orgunits_with_params, + status=200, ) iaso = IASO("https://iaso-staging.bluesquare.org", "username", "password") r = iaso.get_org_units() assert len(r) > 0 + def test_get_forms(self, mock_responses): mock_responses.add( responses.POST, "https://iaso-staging.bluesquare.org/api/token/", json=iaso_mocked_auth_token, status=200