Skip to content

Commit 2ab84ed

Browse files
committed
fix: update tests to handle dict responses correctly
1 parent 6eb8caa commit 2ab84ed

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ def test_successful_request(self, mock_request):
143143
client = BMRSClient(api_key="test-key")
144144
result = client.get_system_demand(from_date=date.today(), to_date=date.today())
145145

146+
# Result is a dict (not parsed as Pydantic model in base client)
147+
assert isinstance(result, dict)
146148
assert "data" in result
147149
assert len(result["data"]) == 1
148150

@@ -171,8 +173,11 @@ def test_get_generation_by_fuel_type(self, mock_request):
171173
settlement_period_to=48,
172174
)
173175

176+
# Result is a dict (not parsed as Pydantic model in base client)
177+
assert isinstance(result, dict)
174178
assert "data" in result
175179
assert len(result["data"]) == 1
180+
assert result["data"][0]["fuelType"] == "WIND"
176181
# Verify the request was made with correct parameters
177182
call_args = mock_request.call_args
178183
assert call_args[1]["params"]["FromSettlementDate"] == "2024-01-01"

0 commit comments

Comments
 (0)