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:
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user