mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Create httpx helper to wrap a shared httpx.AsyncClient (#43877)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
@@ -6,8 +6,10 @@ import httpx
|
||||
import respx
|
||||
|
||||
from homeassistant import config as hass_config
|
||||
from homeassistant.components.homeassistant import SERVICE_UPDATE_ENTITY
|
||||
import homeassistant.components.sensor as sensor
|
||||
from homeassistant.const import (
|
||||
ATTR_ENTITY_ID,
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
CONTENT_TYPE_JSON,
|
||||
DATA_MEGABYTES,
|
||||
@@ -151,10 +153,21 @@ async def test_setup_get(hass):
|
||||
}
|
||||
},
|
||||
)
|
||||
await async_setup_component(hass, "homeassistant", {})
|
||||
|
||||
await hass.async_block_till_done()
|
||||
assert len(hass.states.async_all()) == 1
|
||||
|
||||
assert hass.states.get("sensor.foo").state == ""
|
||||
await hass.services.async_call(
|
||||
"homeassistant",
|
||||
SERVICE_UPDATE_ENTITY,
|
||||
{ATTR_ENTITY_ID: "sensor.foo"},
|
||||
blocking=True,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
assert hass.states.get("sensor.foo").state == ""
|
||||
|
||||
|
||||
@respx.mock
|
||||
async def test_setup_get_digest_auth(hass):
|
||||
|
||||
Reference in New Issue
Block a user