Remove legacy_api_password auth provider (#119976)

This commit is contained in:
Robert Resch 2024-06-19 22:46:30 +02:00 committed by GitHub
parent 7d14b9c5c8
commit bae008b0e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 14 additions and 285 deletions

View file

@ -12,9 +12,6 @@ import voluptuous as vol
from homeassistant import const
from homeassistant.auth.models import Credentials
from homeassistant.auth.providers.legacy_api_password import (
LegacyApiPasswordAuthProvider,
)
from homeassistant.bootstrap import DATA_LOGGING
import homeassistant.core as ha
from homeassistant.core import HomeAssistant
@ -731,22 +728,6 @@ async def test_rendering_template_admin(
assert resp.status == HTTPStatus.UNAUTHORIZED
async def test_rendering_template_legacy_user(
hass: HomeAssistant,
mock_api_client: TestClient,
aiohttp_client: ClientSessionGenerator,
legacy_auth: LegacyApiPasswordAuthProvider,
) -> None:
"""Test rendering a template with legacy API password."""
hass.states.async_set("sensor.temperature", 10)
client = await aiohttp_client(hass.http.app)
resp = await client.post(
const.URL_API_TEMPLATE,
json={"template": "{{ states.sensor.temperature.state }}"},
)
assert resp.status == HTTPStatus.UNAUTHORIZED
async def test_api_call_service_not_found(
hass: HomeAssistant, mock_api_client: TestClient
) -> None: