mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Make release channel a hardcoded enum rather than a free form string (#115595)
* Make release channel a hardcoded enum rather than a free form string * Update enum comparison to remove equality and us identity comparison * Fix comparison condition to match the previous implementation * Update tests to use Enum instead of string
This commit is contained in:
@@ -28,6 +28,7 @@ from homeassistant.core import (
|
||||
HassJobType,
|
||||
HomeAssistant,
|
||||
HomeAssistantError,
|
||||
ReleaseChannel,
|
||||
callback,
|
||||
)
|
||||
from homeassistant.helpers import device_registry as dr, entity, entity_registry as er
|
||||
@@ -1249,7 +1250,7 @@ async def test_entity_name_translation_placeholders(
|
||||
},
|
||||
},
|
||||
{"placeholder": "special"},
|
||||
"stable",
|
||||
ReleaseChannel.STABLE,
|
||||
(
|
||||
"has translation placeholders '{'placeholder': 'special'}' which do "
|
||||
"not match the name '{placeholder} English ent {2ndplaceholder}'"
|
||||
@@ -1263,7 +1264,7 @@ async def test_entity_name_translation_placeholders(
|
||||
},
|
||||
},
|
||||
{"placeholder": "special"},
|
||||
"beta",
|
||||
ReleaseChannel.BETA,
|
||||
"HomeAssistantError: Missing placeholder '2ndplaceholder'",
|
||||
),
|
||||
(
|
||||
@@ -1274,7 +1275,7 @@ async def test_entity_name_translation_placeholders(
|
||||
},
|
||||
},
|
||||
None,
|
||||
"stable",
|
||||
ReleaseChannel.STABLE,
|
||||
(
|
||||
"has translation placeholders '{}' which do "
|
||||
"not match the name '{placeholder} English ent'"
|
||||
@@ -1287,7 +1288,7 @@ async def test_entity_name_translation_placeholder_errors(
|
||||
translation_key: str | None,
|
||||
translations: dict[str, str] | None,
|
||||
placeholders: dict[str, str] | None,
|
||||
release_channel: str,
|
||||
release_channel: ReleaseChannel,
|
||||
expected_error: str,
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user