mirror of
https://github.com/home-assistant/core.git
synced 2026-09-28 02:18:10 -04:00
Log instead of ValueError for missing cloud translation key (#144732)
* Log instead of ValueError for missing translation key * Update homeassistant/components/cloud/client.py
This commit is contained in:
@@ -482,19 +482,20 @@ async def test_async_create_repair_issue_unknown(
|
||||
cloud: MagicMock,
|
||||
mock_cloud_setup: None,
|
||||
issue_registry: ir.IssueRegistry,
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
) -> None:
|
||||
"""Test not creating repair issue for unknown repairs."""
|
||||
identifier = "abc123"
|
||||
with pytest.raises(
|
||||
ValueError,
|
||||
match="Invalid translation key unknown_translation_key",
|
||||
):
|
||||
await cloud.client.async_create_repair_issue(
|
||||
identifier=identifier,
|
||||
translation_key="unknown_translation_key",
|
||||
placeholders={"custom_domains": "example.com"},
|
||||
severity="error",
|
||||
)
|
||||
await cloud.client.async_create_repair_issue(
|
||||
identifier=identifier,
|
||||
translation_key="unknown_translation_key",
|
||||
placeholders={"custom_domains": "example.com"},
|
||||
severity="error",
|
||||
)
|
||||
assert (
|
||||
"Invalid translation key unknown_translation_key for repair issue abc123"
|
||||
in caplog.text
|
||||
)
|
||||
issue = issue_registry.async_get_issue(domain=DOMAIN, issue_id=identifier)
|
||||
assert issue is None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user