Yoda assertion style removed is (#48142)

This commit is contained in:
Franck Nijhof
2021-03-20 13:55:10 +01:00
committed by GitHub
parent 365e8a74ee
commit 5a2b5fe7c5
75 changed files with 1137 additions and 1148 deletions

View File

@@ -8,17 +8,17 @@ from homeassistant.const import STATE_OFF, STATE_ON
def test_state():
"""Test binary sensor state."""
sensor = binary_sensor.BinarySensorEntity()
assert STATE_OFF == sensor.state
assert sensor.state == STATE_OFF
with mock.patch(
"homeassistant.components.binary_sensor.BinarySensorEntity.is_on",
new=False,
):
assert STATE_OFF == binary_sensor.BinarySensorEntity().state
assert binary_sensor.BinarySensorEntity().state == STATE_OFF
with mock.patch(
"homeassistant.components.binary_sensor.BinarySensorEntity.is_on",
new=True,
):
assert STATE_ON == binary_sensor.BinarySensorEntity().state
assert binary_sensor.BinarySensorEntity().state == STATE_ON
def test_deprecated_base_class(caplog):