1
0
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:
Robert Svensson
2021-02-09 08:31:29 +01:00
committed by GitHub
parent b33753f334
commit 20f45f8ab9
16 changed files with 700 additions and 857 deletions

View File

@@ -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