Clean up RFLink tests and add two tests (#19511)

* some minor tests refactor

* unused import
This commit is contained in:
javicalle authored and Martin Hjelmare committed 2018-12-22 08:53:02 +01:00
1 parent 3a3d488de3
commit fb226e3e3b
5 files changed
+136 -143

No files matched your search

@@ -7,7 +7,6 @@ automatic sensor creation.
from datetime import timedelta
from unittest.mock import patch
from ..test_rflink import mock_rflink
from homeassistant.components.rflink import (
CONF_RECONNECT_INTERVAL)
@@ -17,6 +16,7 @@ from homeassistant.const import (
import homeassistant.util.dt as dt_util
from tests.common import async_fire_time_changed
from ..test_rflink import mock_rflink
DOMAIN = 'binary_sensor'
@@ -46,7 +46,7 @@ CONFIG = {
async def test_default_setup(hass, monkeypatch):
"""Test all basic functionality of the rflink sensor component."""
# setup mocking rflink module
event_callback, create, _, disconnect_callback = await mock_rflink(
event_callback, create, _, _ = await mock_rflink(
hass, CONFIG, DOMAIN, monkeypatch)
# make sure arguments are passed
@@ -86,7 +86,7 @@ async def test_entity_availability(hass, monkeypatch):
config[CONF_RECONNECT_INTERVAL] = 60
# Create platform and entities
event_callback, create, _, disconnect_callback = await mock_rflink(
_, _, _, disconnect_callback = await mock_rflink(
hass, config, DOMAIN, monkeypatch, failures=failures)
# Entities are available by default
@@ -114,7 +114,7 @@ async def test_entity_availability(hass, monkeypatch):
async def test_off_delay(hass, monkeypatch):
"""Test off_delay option."""
# setup mocking rflink module
event_callback, create, _, disconnect_callback = await mock_rflink(
event_callback, create, _, _ = await mock_rflink(
hass, CONFIG, DOMAIN, monkeypatch)
# make sure arguments are passed