mirror of
https://github.com/home-assistant/core.git
synced 2025-12-25 05:26:47 +00:00
Black
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user