Skip to content

Commit

Permalink
chore: update formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarfil committed Oct 10, 2024
1 parent a319874 commit 442a60c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion openhexa/toolbox/iaso/iaso.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 8 additions & 2 deletions tests/iaso/test_iaso.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)


Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 442a60c

Please sign in to comment.