mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
GoogleSolarApi delegates get_building_insights to GoogleSolarApiClient 🟥
This commit is contained in:
parent
074cbf2f5a
commit
3f43dacfb9
1 changed files with 26 additions and 0 deletions
26
tests/infrastructure/solar/test_google_solar_api_wiring.py
Normal file
26
tests/infrastructure/solar/test_google_solar_api_wiring.py
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
from typing import Any
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
|
from backend.apis.GoogleSolarApi import GoogleSolarApi
|
||||||
|
from infrastructure.solar.google_solar_api_client import (
|
||||||
|
BuildingInsightsNotFoundError,
|
||||||
|
GoogleSolarApiClient,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Slice 1: get_building_insights delegates to _solar_client
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_building_insights_delegates_to_solar_client() -> None:
|
||||||
|
# Arrange
|
||||||
|
payload: dict[str, Any] = {"solarPotential": {"maxArrayPanelsCount": 20}}
|
||||||
|
with patch.object(GoogleSolarApiClient, "get_building_insights", return_value=payload):
|
||||||
|
api = GoogleSolarApi(api_key="test-key", solar_materials=[])
|
||||||
|
|
||||||
|
# Act
|
||||||
|
result = api.get_building_insights(longitude=-0.1278, latitude=51.5074)
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
assert result == payload
|
||||||
Loading…
Add table
Reference in a new issue