|
12 | 12 |
|
13 | 13 | from bsblan import BSBLAN, BSBLANConfig |
14 | 14 | from bsblan.constants import API_FULL |
15 | | -from bsblan.exceptions import BSBLANError |
| 15 | +from bsblan.exceptions import BSBLANError, BSBLANUnsupportedFeatureError |
16 | 16 | from bsblan.models import HotWaterConfig, HotWaterSchedule |
17 | 17 | from bsblan.utility import APIValidator |
18 | 18 | from tests import load_fixture |
@@ -253,11 +253,14 @@ async def test_hot_water_schedule_no_params_error( |
253 | 253 | bsblan._validator._validated_hot_water_groups.add("schedule") |
254 | 254 |
|
255 | 255 | with pytest.raises( |
256 | | - BSBLANError, |
| 256 | + BSBLANUnsupportedFeatureError, |
257 | 257 | match="No hot water schedule parameters available", |
258 | | - ): |
| 258 | + ) as exc_info: |
259 | 259 | await bsblan.hot_water_schedule() |
260 | 260 |
|
| 261 | + # Permanent error must remain catchable as the generic BSBLANError. |
| 262 | + assert isinstance(exc_info.value, BSBLANError) |
| 263 | + |
261 | 264 |
|
262 | 265 | @pytest.mark.asyncio |
263 | 266 | async def test_hot_water_state_no_params_error( |
@@ -285,9 +288,12 @@ async def test_hot_water_state_no_params_error( |
285 | 288 | with pytest.raises( |
286 | 289 | BSBLANError, |
287 | 290 | match="No essential hot water parameters available", |
288 | | - ): |
| 291 | + ) as exc_info: |
289 | 292 | await bsblan.hot_water_state() |
290 | 293 |
|
| 294 | + # State group must NOT be reclassified as an unsupported-feature error. |
| 295 | + assert not isinstance(exc_info.value, BSBLANUnsupportedFeatureError) |
| 296 | + |
291 | 297 |
|
292 | 298 | @pytest.mark.asyncio |
293 | 299 | async def test_granular_hot_water_validation( |
|
0 commit comments