mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Fail on unused ignore_translations fixture (#128422)
* Fail on unused ignore_translations fixture * Cleanup melcloud * Use pytest.fail * Cleanup tplink * Cleanup matter
This commit is contained in:
@@ -48,18 +48,6 @@ NAME = "Name"
|
||||
TEST_DOMAIN = "fake_integration"
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def ignore_translations() -> list[str]:
|
||||
"""Ignore specific translations.
|
||||
|
||||
We can ignore translations for the fake_integration we are testing with.
|
||||
"""
|
||||
return [
|
||||
f"component.{TEST_DOMAIN}.config.abort.missing_configuration",
|
||||
f"component.{TEST_DOMAIN}.config.abort.missing_credentials",
|
||||
]
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def authorization_server() -> AuthorizationServer:
|
||||
"""Fixture AuthorizationServer for mock application_credentials integration."""
|
||||
@@ -435,6 +423,10 @@ async def test_import_named_credential(
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ignore_translations",
|
||||
["component.fake_integration.config.abort.missing_credentials"],
|
||||
)
|
||||
async def test_config_flow_no_credentials(hass: HomeAssistant) -> None:
|
||||
"""Test config flow base case with no credentials registered."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
@@ -444,6 +436,10 @@ async def test_config_flow_no_credentials(hass: HomeAssistant) -> None:
|
||||
assert result.get("reason") == "missing_credentials"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ignore_translations",
|
||||
["component.fake_integration.config.abort.missing_credentials"],
|
||||
)
|
||||
async def test_config_flow_other_domain(
|
||||
hass: HomeAssistant,
|
||||
ws_client: ClientFixture,
|
||||
@@ -571,6 +567,10 @@ async def test_config_flow_multiple_entries(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ignore_translations",
|
||||
["component.fake_integration.config.abort.missing_credentials"],
|
||||
)
|
||||
async def test_config_flow_create_delete_credential(
|
||||
hass: HomeAssistant,
|
||||
ws_client: ClientFixture,
|
||||
@@ -616,6 +616,10 @@ async def test_config_flow_with_config_credential(
|
||||
assert result["data"].get("auth_implementation") == TEST_DOMAIN
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ignore_translations",
|
||||
["component.fake_integration.config.abort.missing_configuration"],
|
||||
)
|
||||
@pytest.mark.parametrize("mock_application_credentials_integration", [None])
|
||||
async def test_import_without_setup(hass: HomeAssistant, config_credential) -> None:
|
||||
"""Test import of credentials without setting up the integration."""
|
||||
@@ -631,6 +635,10 @@ async def test_import_without_setup(hass: HomeAssistant, config_credential) -> N
|
||||
assert result.get("reason") == "missing_configuration"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ignore_translations",
|
||||
["component.fake_integration.config.abort.missing_configuration"],
|
||||
)
|
||||
@pytest.mark.parametrize("mock_application_credentials_integration", [None])
|
||||
async def test_websocket_without_platform(
|
||||
hass: HomeAssistant, ws_client: ClientFixture
|
||||
|
||||
Reference in New Issue
Block a user