mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +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:
@@ -11,7 +11,7 @@ from yarl import URL
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED
|
||||
from homeassistant.core import CoreState, HomeAssistant
|
||||
from homeassistant.core import CoreState, HomeAssistant, ReleaseChannel
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers import (
|
||||
area_registry as ar,
|
||||
@@ -2390,7 +2390,7 @@ async def test_device_name_translation_placeholders(
|
||||
},
|
||||
},
|
||||
{"placeholder": "special"},
|
||||
"stable",
|
||||
ReleaseChannel.STABLE,
|
||||
nullcontext(),
|
||||
(
|
||||
"has translation placeholders '{'placeholder': 'special'}' which do "
|
||||
@@ -2405,7 +2405,7 @@ async def test_device_name_translation_placeholders(
|
||||
},
|
||||
},
|
||||
{"placeholder": "special"},
|
||||
"beta",
|
||||
ReleaseChannel.BETA,
|
||||
pytest.raises(
|
||||
HomeAssistantError, match="Missing placeholder '2ndplaceholder'"
|
||||
),
|
||||
@@ -2419,7 +2419,7 @@ async def test_device_name_translation_placeholders(
|
||||
},
|
||||
},
|
||||
None,
|
||||
"stable",
|
||||
ReleaseChannel.STABLE,
|
||||
nullcontext(),
|
||||
(
|
||||
"has translation placeholders '{}' which do "
|
||||
@@ -2434,7 +2434,7 @@ async def test_device_name_translation_placeholders_errors(
|
||||
translation_key: str | None,
|
||||
translations: dict[str, str] | None,
|
||||
placeholders: dict[str, str] | None,
|
||||
release_channel: str,
|
||||
release_channel: ReleaseChannel,
|
||||
expectation: AbstractContextManager,
|
||||
expected_error: str,
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
|
||||
Reference in New Issue
Block a user