bitwise and for test supported_features (#58097)

pull/58110/head
Jan Bouwhuis 2021-10-20 15:31:23 +02:00 committed by GitHub
parent b507b9ebfb
commit e2303dc713
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -871,7 +871,7 @@ async def test_implemented_percentage(hass, speed_count, percentage_step):
state = hass.states.get("fan.mechanical_ventilation") state = hass.states.get("fan.mechanical_ventilation")
attributes = state.attributes attributes = state.attributes
assert attributes["percentage_step"] == percentage_step assert attributes["percentage_step"] == percentage_step
assert attributes.get("supported_features") or SUPPORT_SET_SPEED assert attributes.get("supported_features") & SUPPORT_SET_SPEED
@pytest.mark.parametrize("count,domain", [(1, DOMAIN)]) @pytest.mark.parametrize("count,domain", [(1, DOMAIN)])
@ -939,7 +939,7 @@ async def test_implemented_preset_mode(hass, start_ha):
state = hass.states.get("fan.mechanical_ventilation") state = hass.states.get("fan.mechanical_ventilation")
attributes = state.attributes attributes = state.attributes
assert attributes.get("percentage") is None assert attributes.get("percentage") is None
assert attributes.get("supported_features") or SUPPORT_PRESET_MODE assert attributes.get("supported_features") & SUPPORT_PRESET_MODE
@pytest.mark.parametrize("count,domain", [(1, DOMAIN)]) @pytest.mark.parametrize("count,domain", [(1, DOMAIN)])