Add Abode tests (#32562)
* Add tests for several devices * Update coveragerc * Code review changes and minor clean up * More code review changes * Update manifest and minor test updates * Add test for locks and covers * Add tests for switch on and off * Add more complete test for alarms * Fix for camera test * Patch abodepy.mode for tests * Add test for unknown alarm state and minor cleanup * Update to make tests more robust * More specific tests * Update quality scale to silver * Remove integration quality scale
This commit is contained in:
1 parent
d62bb9ed47
commit
d36259f067
18 files changed
+1904
-9
No files matched your search
@@ -0,0 +1,25 @@
|
||||
"""Common methods used across tests for Abode."""
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant.components.abode import DOMAIN as ABODE_DOMAIN
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
async def setup_platform(hass, platform):
|
||||
"""Set up the Abode platform."""
|
||||
mock_entry = MockConfigEntry(
|
||||
domain=ABODE_DOMAIN,
|
||||
data={CONF_USERNAME: "user@email.com", CONF_PASSWORD: "password"},
|
||||
)
|
||||
mock_entry.add_to_hass(hass)
|
||||
|
||||
with patch("homeassistant.components.abode.ABODE_PLATFORMS", [platform]), patch(
|
||||
"abodepy.event_controller.sio"
|
||||
), patch("abodepy.utils.save_cache"):
|
||||
assert await async_setup_component(hass, ABODE_DOMAIN, {})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
return mock_entry
|
||||
Reference in new issue
Block a user