From 796760b4760ac0baee5239989d80464bb18389bc Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 1 Apr 2026 19:32:03 +0200 Subject: [PATCH] Fix pylint protected-access warnings in tests Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/addons/test_manager.py | 2 +- tests/api/test_auth.py | 4 ++-- tests/api/test_discovery.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/addons/test_manager.py b/tests/addons/test_manager.py index f842b1ee2..18507974e 100644 --- a/tests/addons/test_manager.py +++ b/tests/addons/test_manager.py @@ -246,7 +246,7 @@ async def test_addon_uninstall_removes_discovery( assert message.service == "mqtt" assert coresys.discovery.list_messages == [message] - coresys.homeassistant.api._ensure_access_token = AsyncMock() + coresys.homeassistant.api._ensure_access_token = AsyncMock() # pylint: disable=protected-access await coresys.addons.uninstall(TEST_ADDON_SLUG) await asyncio.sleep(0) diff --git a/tests/api/test_auth.py b/tests/api/test_auth.py index 4dddd5306..bcdac6f97 100644 --- a/tests/api/test_auth.py +++ b/tests/api/test_auth.py @@ -88,7 +88,7 @@ async def test_password_reset( websession: MagicMock, ): """Test password reset api.""" - coresys.homeassistant.api._access_token = "abc123" + coresys.homeassistant.api._access_token = "abc123" # pylint: disable=protected-access # pylint: disable-next=protected-access coresys.homeassistant.api._access_token_expires = datetime.now(tz=UTC) + timedelta( days=1 @@ -124,7 +124,7 @@ async def test_failed_password_reset( expected_log: str, ): """Test failed password reset.""" - coresys.homeassistant.api._access_token = "abc123" + coresys.homeassistant.api._access_token = "abc123" # pylint: disable=protected-access # pylint: disable-next=protected-access coresys.homeassistant.api._access_token_expires = datetime.now(tz=UTC) + timedelta( days=1 diff --git a/tests/api/test_discovery.py b/tests/api/test_discovery.py index 8769a2a1e..95351a2d9 100644 --- a/tests/api/test_discovery.py +++ b/tests/api/test_discovery.py @@ -91,7 +91,7 @@ async def test_api_send_del_discovery( ): """Test adding and removing discovery.""" install_addon_ssh.data["discovery"] = ["test"] - coresys.homeassistant.api._ensure_access_token = AsyncMock() + coresys.homeassistant.api._ensure_access_token = AsyncMock() # pylint: disable=protected-access resp = await api_client.post("/discovery", json={"service": "test", "config": {}}) assert resp.status == 200