Avoid using implementation internal to trigger events (#38041)

This uses the moxking in fixture to trigger events.
This commit is contained in:
Joakim Plate authored and GitHub committed 2020-07-22 00:24:26 +02:00
1 parent 945acb4e29
commit 7a3c6d6525
8 files changed
+41 -50

No files matched your search

+2 -4
View File
@@ -6,8 +6,6 @@ import pytest
from homeassistant.core import State
from homeassistant.setup import async_setup_component
from . import _signal_event
from tests.common import mock_restore_cache
@@ -130,12 +128,12 @@ async def test_discover_switch(hass, rfxtrx):
await hass.async_block_till_done()
await hass.async_start()
await _signal_event(hass, "0b1100100118cdea02010f70")
await rfxtrx.signal("0b1100100118cdea02010f70")
state = hass.states.get("switch.ac_118cdea_2")
assert state
assert state.state == "on"
await _signal_event(hass, "0b1100100118cdeb02010f70")
await rfxtrx.signal("0b1100100118cdeb02010f70")
state = hass.states.get("switch.ac_118cdeb_2")
assert state
assert state.state == "on"