Skip to content

Commit

Permalink
Update test_config_flow.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dolezsa authored Oct 16, 2024
1 parent 841ab48 commit f4f4574
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,20 @@ async def test_config_flow_enabled():
assert manifest.get("config_flow") is True


@pytest.mark.parametrize(*DEFAULT_TEST_SENSORS)
@pytest.mark.parametrize("sensor", [CONF_TEMPERATURE_SENSOR, CONF_HUMIDITY_SENSOR])
async def test_missed_sensors(hass, sensor, start_ha):
"""Test is we show message if sensor missed."""

result = await _flow_init(hass)

# Check that the config flow shows the user form as the first step
assert result["type"] == FlowResultType.FORM
assert result["step_id"] == "user"

no_sensor = dict(ADVANCED_USER_INPUT)
no_sensor[sensor] = "foo"
with pytest.raises(vol.error.MultipleInvalid):
result = await _flow_configure(hass, result, no_sensor)

assert result["type"] == FlowResultType.FORM
#@pytest.mark.parametrize(*DEFAULT_TEST_SENSORS)
#@pytest.mark.parametrize("sensor", [CONF_TEMPERATURE_SENSOR, CONF_HUMIDITY_SENSOR])
#async def test_missed_sensors(hass, sensor, start_ha):
# """Test is we show message if sensor missed."""
#
# result = await _flow_init(hass)
#
# # Check that the config flow shows the user form as the first step
# assert result["type"] == FlowResultType.FORM
# assert result["step_id"] == "user"
#
# no_sensor = dict(ADVANCED_USER_INPUT)
# no_sensor[sensor] = "foo"
# with pytest.raises(vol.error.MultipleInvalid):
# result = await _flow_configure(hass, result, no_sensor)
#
# assert result["type"] == FlowResultType.FORM

0 comments on commit f4f4574

Please sign in to comment.