mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 05:35:11 +02:00
add a bit more coverage just to be sure
This commit is contained in:
@@ -349,6 +349,16 @@ async def test_api_template(hass: HomeAssistant, mock_api_client: TestClient) ->
|
|||||||
|
|
||||||
assert body == "10"
|
assert body == "10"
|
||||||
|
|
||||||
|
hass.states.async_set("sensor.temperature", 20)
|
||||||
|
resp = await mock_api_client.post(
|
||||||
|
const.URL_API_TEMPLATE,
|
||||||
|
json={"template": "{{ states.sensor.temperature.state }}"},
|
||||||
|
)
|
||||||
|
|
||||||
|
body = await resp.text()
|
||||||
|
|
||||||
|
assert body == "20"
|
||||||
|
|
||||||
|
|
||||||
async def test_api_template_error(
|
async def test_api_template_error(
|
||||||
hass: HomeAssistant, mock_api_client: TestClient
|
hass: HomeAssistant, mock_api_client: TestClient
|
||||||
|
Reference in New Issue
Block a user