Set the quality scale to platinum for IMGW-PIB integration (#116912)

* Increase test coverage

* Set the quality scale to platinum

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
pull/117061/head
Maciej Bieniek 2024-05-08 08:51:25 +02:00 committed by GitHub
parent 2891a63281
commit e16a88a9c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -5,5 +5,6 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/imgw_pib",
"iot_class": "cloud_polling",
"quality_scale": "platinum",
"requirements": ["imgw_pib==1.0.1"]
}

View File

@ -1,6 +1,6 @@
"""Test init of IMGW-PIB integration."""
from unittest.mock import AsyncMock
from unittest.mock import AsyncMock, patch
from imgw_pib import ApiError
@ -15,12 +15,13 @@ from tests.common import MockConfigEntry
async def test_config_not_ready(
hass: HomeAssistant,
mock_imgw_pib_client: AsyncMock,
mock_config_entry: MockConfigEntry,
) -> None:
"""Test for setup failure if the connection to the service fails."""
mock_imgw_pib_client.get_hydrological_data.side_effect = ApiError("API Error")
with patch(
"homeassistant.components.imgw_pib.ImgwPib.create",
side_effect=ApiError("API Error"),
):
await init_integration(hass, mock_config_entry)
assert mock_config_entry.state is ConfigEntryState.SETUP_RETRY