Skip to content

Commit

Permalink
Fix typo in method naming (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
tr4nt0r authored Jun 20, 2024
1 parent e2d44ce commit a003f70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/pyecotrend_ista/pyecotrend_ista.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def consum_raw( # noqa: C901
"""
# Fetch raw consumption data for the specified UUID
c_raw: ConsumptionsResponse = self.get_comsumption_data(obj_uuid)
c_raw: ConsumptionsResponse = self.get_consumption_data(obj_uuid)

if not isinstance(c_raw, dict) or (c_raw.get("consumptions") is None and c_raw.get("costs") is None):
return c_raw
Expand Down Expand Up @@ -807,7 +807,7 @@ def consum_raw( # noqa: C901
}
).to_dict()

def get_comsumption_data(self, obj_uuid: str | None = None) -> ConsumptionsResponse:
def get_consumption_data(self, obj_uuid: str | None = None) -> ConsumptionsResponse:
"""Fetch consumption data from the API for a specific consumption unit.
Parameters
Expand Down Expand Up @@ -863,7 +863,7 @@ def get_comsumption_data(self, obj_uuid: str | None = None) -> ConsumptionsRespo
except requests.RequestException as exc:
raise ServerError("Loading consumption data failed due to a request exception") from exc

get_raw = deprecated(get_comsumption_data, "get_raw")
get_raw = deprecated(get_consumption_data, "get_raw")

def get_consumption_unit_details(self) -> ConsumptionUnitDetailsResponse:
"""Retrieve details of the consumption unit from the API.
Expand Down
6 changes: 3 additions & 3 deletions tests/test_consumptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_get_comsumption_data(ista_client: PyEcotrendIsta, requests_mock: Reques

requests_mock.get(f"{API_BASE_URL}consumptions", json=dataset["test_data"])

assert ista_client.get_comsumption_data("26e93f1a-c828-11ea-87d0-0242ac130003") == snapshot
assert ista_client.get_consumption_data("26e93f1a-c828-11ea-87d0-0242ac130003") == snapshot


@pytest.mark.parametrize(
Expand All @@ -42,7 +42,7 @@ def test_get_comsumption_data_http_errors(
)

with pytest.raises(expected_exception=expected_exception):
ista_client.get_comsumption_data("26e93f1a-c828-11ea-87d0-0242ac130003")
ista_client.get_consumption_data("26e93f1a-c828-11ea-87d0-0242ac130003")


@pytest.mark.parametrize(
Expand All @@ -56,7 +56,7 @@ def test_get_comsumption_data_exceptions(requests_mock: RequestsMock, ista_clien
)

with pytest.raises(expected_exception=expected_exception):
ista_client.get_comsumption_data("26e93f1a-c828-11ea-87d0-0242ac130003")
ista_client.get_consumption_data("26e93f1a-c828-11ea-87d0-0242ac130003")


def test_consum_raw(ista_client: PyEcotrendIsta, requests_mock: RequestsMock, snapshot: SnapshotAssertion, dataset) -> None:
Expand Down

0 comments on commit a003f70

Please sign in to comment.