diff --git a/src/pyecotrend_ista/pyecotrend_ista.py b/src/pyecotrend_ista/pyecotrend_ista.py index 4522e58..6b46606 100644 --- a/src/pyecotrend_ista/pyecotrend_ista.py +++ b/src/pyecotrend_ista/pyecotrend_ista.py @@ -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 @@ -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 @@ -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. diff --git a/tests/test_consumptions.py b/tests/test_consumptions.py index 8cea08d..b0cd817 100644 --- a/tests/test_consumptions.py +++ b/tests/test_consumptions.py @@ -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( @@ -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( @@ -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: