Address late review of Minor AndroidTV config flow (#64088)
* Minor changes for AndroidTV config flow * Add mark.parametrize to media_player tests
This commit is contained in:
parent
5a33610739
commit
a978661545
4 changed files with 65 additions and 157 deletions
|
@ -3,6 +3,8 @@ import json
|
|||
from socket import gaierror
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant import data_entry_flow
|
||||
from homeassistant.components.androidtv.config_flow import (
|
||||
APPS_NEW_ID,
|
||||
|
@ -92,7 +94,8 @@ class MockConfigDevice:
|
|||
self.available = False
|
||||
|
||||
|
||||
async def _test_user(hass, config):
|
||||
@pytest.mark.parametrize("config", [CONFIG_PYTHON_ADB, CONFIG_ADB_SERVER])
|
||||
async def test_user(hass, config):
|
||||
"""Test user config."""
|
||||
flow_result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_USER, "show_advanced_options": True}
|
||||
|
@ -117,16 +120,6 @@ async def _test_user(hass, config):
|
|||
assert len(mock_setup_entry.mock_calls) == 1
|
||||
|
||||
|
||||
async def test_user_python_adb(hass):
|
||||
"""Test user config for Python ADB."""
|
||||
await _test_user(hass, CONFIG_PYTHON_ADB)
|
||||
|
||||
|
||||
async def test_user_adb_server(hass):
|
||||
"""Test user config for ADB server."""
|
||||
await _test_user(hass, CONFIG_ADB_SERVER)
|
||||
|
||||
|
||||
async def test_import(hass):
|
||||
"""Test import config."""
|
||||
|
||||
|
@ -179,7 +172,6 @@ async def test_import_data(hass):
|
|||
config_data[CONF_PLATFORM] = DOMAIN
|
||||
config_data[CONF_ADBKEY] = ADBKEY
|
||||
config_data[CONF_TURN_OFF_COMMAND] = "off"
|
||||
config_data[CONF_STATE_DETECTION_RULES] = {"a": "b"}
|
||||
platform_data = {MP_DOMAIN: config_data}
|
||||
|
||||
with patch(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue