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