1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00
This commit is contained in:
Paulus Schoutsen
2019-07-31 12:25:30 -07:00
parent da05dfe708
commit 4de97abc3a
2676 changed files with 163166 additions and 140084 deletions

View File

@@ -13,13 +13,13 @@ class TestBinarySensor(unittest.TestCase):
"""Test binary sensor state."""
sensor = binary_sensor.BinarySensorDevice()
assert STATE_OFF == sensor.state
with mock.patch('homeassistant.components.binary_sensor.'
'BinarySensorDevice.is_on',
new=False):
assert STATE_OFF == \
binary_sensor.BinarySensorDevice().state
with mock.patch('homeassistant.components.binary_sensor.'
'BinarySensorDevice.is_on',
new=True):
assert STATE_ON == \
binary_sensor.BinarySensorDevice().state
with mock.patch(
"homeassistant.components.binary_sensor." "BinarySensorDevice.is_on",
new=False,
):
assert STATE_OFF == binary_sensor.BinarySensorDevice().state
with mock.patch(
"homeassistant.components.binary_sensor." "BinarySensorDevice.is_on",
new=True,
):
assert STATE_ON == binary_sensor.BinarySensorDevice().state