Fix canary flaky test (#11519)
parent
8267a21bfe
commit
bccd880395
|
@ -1,10 +1,9 @@
|
|||
"""The tests for the Canary sensor platform."""
|
||||
import copy
|
||||
import unittest
|
||||
from unittest.mock import patch, Mock
|
||||
from unittest.mock import Mock
|
||||
|
||||
from canary.api import SensorType
|
||||
from homeassistant.components import canary as base_canary
|
||||
from homeassistant.components.canary import DATA_CANARY
|
||||
from homeassistant.components.sensor import canary
|
||||
from homeassistant.components.sensor.canary import CanarySensor
|
||||
|
@ -39,16 +38,13 @@ class TestCanarySensorSetup(unittest.TestCase):
|
|||
"""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
@patch('homeassistant.components.canary.CanaryData')
|
||||
def test_setup_sensors(self, mock_canary):
|
||||
def test_setup_sensors(self):
|
||||
"""Test the sensor setup."""
|
||||
base_canary.setup(self.hass, self.config)
|
||||
|
||||
online_device_at_home = mock_device(20, "Dining Room", True)
|
||||
offline_device_at_home = mock_device(21, "Front Yard", False)
|
||||
online_device_at_work = mock_device(22, "Office", True)
|
||||
|
||||
self.hass.data[DATA_CANARY] = mock_canary()
|
||||
self.hass.data[DATA_CANARY] = Mock()
|
||||
self.hass.data[DATA_CANARY].locations = [
|
||||
mock_location("Home", True, devices=[online_device_at_home,
|
||||
offline_device_at_home]),
|
||||
|
|
Loading…
Reference in New Issue