Add tests for Netatmo light (#46381)
* Add tests for Netatmo light * Improve docstring * Register the camera data class for the light platform * Remove freezegun dependency * Update tests * Update tests/components/netatmo/test_light.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * Deduplicate webhook test data * Mock pytest to verify it is called * Don't test internals * Rename * Assert light still on with erroneous event data Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
parent
7858b59944
commit
aaafe399a1
5 changed files with 95 additions and 1 deletions
|
@ -81,6 +81,8 @@ async def mock_sensor_entry_fixture(hass, config_entry):
|
|||
"""Mock setup of sensor platform."""
|
||||
with selected_platforms(["sensor"]):
|
||||
await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
|
||||
await hass.async_block_till_done()
|
||||
return config_entry
|
||||
|
||||
|
||||
|
@ -89,6 +91,8 @@ async def mock_camera_entry_fixture(hass, config_entry):
|
|||
"""Mock setup of camera platform."""
|
||||
with selected_platforms(["camera"]):
|
||||
await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
|
||||
await hass.async_block_till_done()
|
||||
return config_entry
|
||||
|
||||
|
||||
|
@ -97,6 +101,8 @@ async def mock_light_entry_fixture(hass, config_entry):
|
|||
"""Mock setup of light platform."""
|
||||
with selected_platforms(["light"]):
|
||||
await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
|
||||
await hass.async_block_till_done()
|
||||
return config_entry
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue