Use direct service calls in tests instead of automation common (#40623)

* Use direct service calls in tests instead of automation common

* Remove automation common test helpers
This commit is contained in:
Franck Nijhof 2020-09-26 19:28:26 +02:00 committed by GitHub
parent 35533407fe
commit 8837ed35cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 156 additions and 125 deletions

View file

@ -2,11 +2,11 @@
import pytest
from homeassistant.components import automation, zone
from homeassistant.const import ATTR_ENTITY_ID, ENTITY_MATCH_ALL, SERVICE_TURN_OFF
from homeassistant.core import Context
from homeassistant.setup import async_setup_component
from tests.common import async_mock_service, mock_component
from tests.components.automation import common
@pytest.fixture
@ -91,8 +91,12 @@ async def test_if_fires_on_zone_enter(hass, calls):
)
await hass.async_block_till_done()
await common.async_turn_off(hass)
await hass.async_block_till_done()
await hass.services.async_call(
automation.DOMAIN,
SERVICE_TURN_OFF,
{ATTR_ENTITY_ID: ENTITY_MATCH_ALL},
blocking=True,
)
hass.states.async_set(
"test.entity", "hello", {"latitude": 32.880586, "longitude": -117.237564}