mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Improve deCONZ tests by using aioclient_mock rather than patching web requests (#45927)
* Don't patch web requests, use aioclient_mock instead * Remove stale prints * Remove tests for old way of loading platforms * Remove unused imports
This commit is contained in:
@@ -54,11 +54,13 @@ SENSORS = {
|
||||
}
|
||||
|
||||
|
||||
async def test_deconz_events(hass):
|
||||
async def test_deconz_events(hass, aioclient_mock):
|
||||
"""Test successful creation of deconz events."""
|
||||
data = deepcopy(DECONZ_WEB_REQUEST)
|
||||
data["sensors"] = deepcopy(SENSORS)
|
||||
config_entry = await setup_deconz_integration(hass, get_state_response=data)
|
||||
config_entry = await setup_deconz_integration(
|
||||
hass, aioclient_mock, get_state_response=data
|
||||
)
|
||||
gateway = get_gateway_from_config_entry(hass, config_entry)
|
||||
|
||||
assert len(hass.states.async_all()) == 3
|
||||
|
||||
Reference in New Issue
Block a user