async def test_flow_link_unknown_host(hass): """Test config flow .""" flow = hue.HueFlowHandler() flow.hass = hass with patch('aiohue.Bridge.create_user', side_effect=aiohue.RequestError): result = await flow.async_step_link({}) assert result['type'] == 'form' assert result['step_id'] == 'link' assert result['errors'] == {'base': 'register_failed'}
async def test_flow_link_button_not_pressed(hass): """Test config flow .""" flow = hue.HueFlowHandler() flow.hass = hass with patch('aiohue.Bridge.create_user', side_effect=aiohue.LinkButtonNotPressed): result = await flow.async_step_link({}) assert result['type'] == 'form' assert result['step_id'] == 'link' assert result['errors'] == {'base': 'register_failed'}