1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 04:50:05 +00:00

Portainer remove unnecessary patch (#155317)

This commit is contained in:
Erwin Douna
2025-10-28 19:39:08 +01:00
committed by GitHub
parent f38c0d510e
commit a37ba6dba4
2 changed files with 4 additions and 20 deletions

View File

@@ -57,11 +57,7 @@ async def test_buttons(
client_method: str,
) -> None:
"""Test pressing a Portainer container action button triggers client call. Click, click!"""
with patch(
"homeassistant.components.portainer._PLATFORMS",
[Platform.BUTTON],
):
await setup_integration(hass, mock_config_entry)
await setup_integration(hass, mock_config_entry)
entity_id = f"button.practical_morse_{action}_container"
method_mock = getattr(mock_portainer_client, client_method)
@@ -93,11 +89,7 @@ async def test_buttons_exceptions(
client_method: str,
) -> None:
"""Test that Portainer buttons, but this time when they will do boom for sure."""
with patch(
"homeassistant.components.portainer._PLATFORMS",
[Platform.BUTTON],
):
await setup_integration(hass, mock_config_entry)
await setup_integration(hass, mock_config_entry)
action = client_method.split("_")[0]
entity_id = f"button.practical_morse_{action}_container"

View File

@@ -60,11 +60,7 @@ async def test_turn_off_on(
client_method: str,
) -> None:
"""Test the switches. Have you tried to turn it off and on again?"""
with patch(
"homeassistant.components.portainer._PLATFORMS",
[Platform.SWITCH],
):
await setup_integration(hass, mock_config_entry)
await setup_integration(hass, mock_config_entry)
entity_id = "switch.practical_morse_container"
method_mock = getattr(mock_portainer_client, client_method)
@@ -107,11 +103,7 @@ async def test_turn_off_on_exceptions(
expected_exception: Exception,
) -> None:
"""Test the switches. Have you tried to turn it off and on again? This time they will do boom!"""
with patch(
"homeassistant.components.portainer._PLATFORMS",
[Platform.SWITCH],
):
await setup_integration(hass, mock_config_entry)
await setup_integration(hass, mock_config_entry)
entity_id = "switch.practical_morse_container"
method_mock = getattr(mock_portainer_client, client_method)