mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-04-02 00:07:16 +01:00
Fix pylint protected-access warnings in tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user