mirror of
https://github.com/home-assistant/core.git
synced 2025-11-13 21:10:25 +00:00
Make issue creation check architecture instead of uname (#146537)
This commit is contained in:
committed by
GitHub
parent
2f6fcb5801
commit
864e440685
@@ -648,18 +648,24 @@ async def test_reload_all(
|
||||
"armv7",
|
||||
],
|
||||
)
|
||||
async def test_deprecated_installation_issue_32bit_method(
|
||||
async def test_deprecated_installation_issue_32bit_core(
|
||||
hass: HomeAssistant,
|
||||
issue_registry: ir.IssueRegistry,
|
||||
arch: str,
|
||||
) -> None:
|
||||
"""Test deprecated installation issue."""
|
||||
with patch(
|
||||
"homeassistant.components.homeassistant.async_get_system_info",
|
||||
return_value={
|
||||
"installation_type": "Home Assistant Core",
|
||||
"arch": arch,
|
||||
},
|
||||
with (
|
||||
patch(
|
||||
"homeassistant.components.homeassistant.async_get_system_info",
|
||||
return_value={
|
||||
"installation_type": "Home Assistant Core",
|
||||
"arch": arch,
|
||||
},
|
||||
),
|
||||
patch(
|
||||
"homeassistant.components.homeassistant._is_32_bit",
|
||||
return_value=True,
|
||||
),
|
||||
):
|
||||
assert await async_setup_component(hass, DOMAIN, {})
|
||||
await hass.async_block_till_done()
|
||||
@@ -677,46 +683,28 @@ async def test_deprecated_installation_issue_32bit_method(
|
||||
@pytest.mark.parametrize(
|
||||
"arch",
|
||||
[
|
||||
"i386",
|
||||
"armhf",
|
||||
"aarch64",
|
||||
"generic-x86-64",
|
||||
],
|
||||
)
|
||||
async def test_deprecated_installation_issue_32bit(
|
||||
async def test_deprecated_installation_issue_64bit_core(
|
||||
hass: HomeAssistant,
|
||||
issue_registry: ir.IssueRegistry,
|
||||
arch: str,
|
||||
) -> None:
|
||||
"""Test deprecated installation issue."""
|
||||
with patch(
|
||||
"homeassistant.components.homeassistant.async_get_system_info",
|
||||
return_value={
|
||||
"installation_type": "Home Assistant Container",
|
||||
"arch": arch,
|
||||
},
|
||||
):
|
||||
assert await async_setup_component(hass, DOMAIN, {})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert len(issue_registry.issues) == 1
|
||||
issue = issue_registry.async_get_issue(DOMAIN, "deprecated_architecture")
|
||||
assert issue.domain == DOMAIN
|
||||
assert issue.severity == ir.IssueSeverity.WARNING
|
||||
assert issue.translation_placeholders == {
|
||||
"installation_type": "Container",
|
||||
"arch": arch,
|
||||
}
|
||||
|
||||
|
||||
async def test_deprecated_installation_issue_method(
|
||||
hass: HomeAssistant, issue_registry: ir.IssueRegistry
|
||||
) -> None:
|
||||
"""Test deprecated installation issue."""
|
||||
with patch(
|
||||
"homeassistant.components.homeassistant.async_get_system_info",
|
||||
return_value={
|
||||
"installation_type": "Home Assistant Core",
|
||||
"arch": "generic-x86-64",
|
||||
},
|
||||
with (
|
||||
patch(
|
||||
"homeassistant.components.homeassistant.async_get_system_info",
|
||||
return_value={
|
||||
"installation_type": "Home Assistant Core",
|
||||
"arch": arch,
|
||||
},
|
||||
),
|
||||
patch(
|
||||
"homeassistant.components.homeassistant._is_32_bit",
|
||||
return_value=False,
|
||||
),
|
||||
):
|
||||
assert await async_setup_component(hass, DOMAIN, {})
|
||||
await hass.async_block_till_done()
|
||||
@@ -727,26 +715,46 @@ async def test_deprecated_installation_issue_method(
|
||||
assert issue.severity == ir.IssueSeverity.WARNING
|
||||
assert issue.translation_placeholders == {
|
||||
"installation_type": "Core",
|
||||
"arch": "generic-x86-64",
|
||||
"arch": arch,
|
||||
}
|
||||
|
||||
|
||||
async def test_deprecated_installation_issue_armv7_container(
|
||||
@pytest.mark.parametrize(
|
||||
"arch",
|
||||
[
|
||||
"i386",
|
||||
"armv7",
|
||||
"armhf",
|
||||
],
|
||||
)
|
||||
async def test_deprecated_installation_issue_32bit(
|
||||
hass: HomeAssistant,
|
||||
issue_registry: ir.IssueRegistry,
|
||||
arch: str,
|
||||
) -> None:
|
||||
"""Test deprecated installation issue."""
|
||||
with patch(
|
||||
"homeassistant.components.homeassistant.async_get_system_info",
|
||||
return_value={
|
||||
"installation_type": "Home Assistant Container",
|
||||
"arch": "armv7",
|
||||
},
|
||||
with (
|
||||
patch(
|
||||
"homeassistant.components.homeassistant.async_get_system_info",
|
||||
return_value={
|
||||
"installation_type": "Home Assistant Container",
|
||||
"arch": arch,
|
||||
},
|
||||
),
|
||||
patch(
|
||||
"homeassistant.components.homeassistant._is_32_bit",
|
||||
return_value=True,
|
||||
),
|
||||
patch(
|
||||
"homeassistant.components.homeassistant._get_arch",
|
||||
return_value=arch,
|
||||
),
|
||||
):
|
||||
assert await async_setup_component(hass, DOMAIN, {})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert len(issue_registry.issues) == 1
|
||||
issue = issue_registry.async_get_issue(DOMAIN, "deprecated_container_armv7")
|
||||
issue = issue_registry.async_get_issue(DOMAIN, "deprecated_container")
|
||||
assert issue.domain == DOMAIN
|
||||
assert issue.severity == ir.IssueSeverity.WARNING
|
||||
assert issue.translation_placeholders == {"arch": arch}
|
||||
|
||||
Reference in New Issue
Block a user