mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 05:05:09 +02:00
Update tests after adding get_hostname_id function
This commit is contained in:
@@ -25,12 +25,15 @@ async def test_formx(hass: HomeAssistant) -> None:
|
|||||||
) as mock_api_class, patch(
|
) as mock_api_class, patch(
|
||||||
"homeassistant.components.kostal_plenticore.async_setup_entry",
|
"homeassistant.components.kostal_plenticore.async_setup_entry",
|
||||||
return_value=True,
|
return_value=True,
|
||||||
) as mock_setup_entry:
|
) as mock_setup_entry, patch(
|
||||||
|
"homeassistant.components.kostal_plenticore.config_flow.get_hostname_id",
|
||||||
|
return_value="Network:Hostname",
|
||||||
|
):
|
||||||
# mock of the context manager instance
|
# mock of the context manager instance
|
||||||
mock_api_ctx = MagicMock()
|
mock_api_ctx = MagicMock()
|
||||||
mock_api_ctx.login = AsyncMock()
|
mock_api_ctx.login = AsyncMock()
|
||||||
mock_api_ctx.get_setting_values = AsyncMock(
|
mock_api_ctx.get_setting_values = AsyncMock(
|
||||||
return_value={"scb:network": {"Hostname": "scb"}}
|
return_value={"scb:network": {"Network:Hostname": "scb"}}
|
||||||
)
|
)
|
||||||
|
|
||||||
# mock of the return instance of ApiClient
|
# mock of the return instance of ApiClient
|
||||||
|
@@ -62,7 +62,20 @@ def mock_get_setting_values(mock_plenticore_client: ApiClient) -> list:
|
|||||||
"id": "Battery:MinHomeComsumption",
|
"id": "Battery:MinHomeComsumption",
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
]
|
],
|
||||||
|
"scb:network": [
|
||||||
|
SettingsData(
|
||||||
|
{
|
||||||
|
"id": "Network:Hostname",
|
||||||
|
"unit": None,
|
||||||
|
"type": "string",
|
||||||
|
"min": "1",
|
||||||
|
"max": "78",
|
||||||
|
"default": None,
|
||||||
|
"access": "readwrite",
|
||||||
|
}
|
||||||
|
),
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
# this values are always retrieved by the integration on startup
|
# this values are always retrieved by the integration on startup
|
||||||
@@ -75,7 +88,7 @@ def mock_get_setting_values(mock_plenticore_client: ApiClient) -> list:
|
|||||||
"Properties:VersionIOC": "01.45",
|
"Properties:VersionIOC": "01.45",
|
||||||
"Properties:VersionMC": " 01.46",
|
"Properties:VersionMC": " 01.46",
|
||||||
},
|
},
|
||||||
"scb:network": {"Hostname": "scb"},
|
"scb:network": {"Network:Hostname": "scb"},
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user