From 7eeb4ec3ca58d68ec488d0885254e28ff23955ad Mon Sep 17 00:00:00 2001 From: Erwin Douna Date: Wed, 5 Aug 2026 08:46:33 +0200 Subject: [PATCH] Remove unneeded test in Portainer (#178185) --- tests/components/portainer/test_services.py | 31 ++------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/tests/components/portainer/test_services.py b/tests/components/portainer/test_services.py index db72f383cc2e..deeff7cdc98d 100644 --- a/tests/components/portainer/test_services.py +++ b/tests/components/portainer/test_services.py @@ -23,14 +23,14 @@ from homeassistant.components.portainer.services import ( _async_get_device, ) from homeassistant.const import ATTR_DEVICE_ID -from homeassistant.core import Context, HomeAssistant +from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError, ServiceValidationError from homeassistant.helpers.device_registry import DeviceRegistry from . import setup_integration from .conftest import TEST_CONTAINER_ID, TEST_CONTAINER_NAME, TEST_ENTRY -from tests.common import MockConfigEntry, MockUser +from tests.common import MockConfigEntry TEST_ENDPOINT_ID = 1 TEST_DEVICE_IDENTIFIER = f"{TEST_ENTRY}_{TEST_ENDPOINT_ID}" @@ -157,33 +157,6 @@ async def test_service_recreate_container( ) -async def test_service_recreate_container_non_admin_rejected( - hass: HomeAssistant, - device_registry: DeviceRegistry, - mock_portainer_client: AsyncMock, - mock_config_entry: MockConfigEntry, - hass_read_only_user: MockUser, -) -> None: - """Test recreate container service requires admin access.""" - - await setup_integration(hass, mock_config_entry) - container = device_registry.async_get_device( - identifiers={(DOMAIN, TEST_CONTAINER_DEVICE_IDENTIFIER)} - ) - assert container is not None - - await hass.services.async_call( - DOMAIN, - SERVICE_RECREATE_CONTAINER, - {ATTR_CONTAINER_DEVICE_ID: container.id, ATTR_PULL_IMAGE: True}, - blocking=False, - context=Context(user_id=hass_read_only_user.id), - ) - await hass.async_block_till_done() - - mock_portainer_client.container_recreate.assert_not_called() - - @pytest.mark.parametrize( ("exception", "translation_key"), [