Change KEY_HASS to be an aiohttp AppKey (#111954)
This commit is contained in:
parent
82efb3d35b
commit
531e25cbc6
10 changed files with 39 additions and 25 deletions
|
@ -17,6 +17,7 @@ from homeassistant.auth.providers.legacy_api_password import (
|
|||
LegacyApiPasswordAuthProvider,
|
||||
)
|
||||
from homeassistant.components import websocket_api
|
||||
from homeassistant.components.http import KEY_HASS
|
||||
from homeassistant.components.http.auth import (
|
||||
CONTENT_USER_NAME,
|
||||
DATA_SIGN_SECRET,
|
||||
|
@ -78,7 +79,7 @@ async def get_legacy_user(auth):
|
|||
def app(hass):
|
||||
"""Fixture to set up a web.Application."""
|
||||
app = web.Application()
|
||||
app["hass"] = hass
|
||||
app[KEY_HASS] = hass
|
||||
app.router.add_get("/", mock_handler)
|
||||
async_setup_forwarded(app, True, [])
|
||||
return app
|
||||
|
@ -88,7 +89,7 @@ def app(hass):
|
|||
def app2(hass):
|
||||
"""Fixture to set up a web.Application without real_ip middleware."""
|
||||
app = web.Application()
|
||||
app["hass"] = hass
|
||||
app[KEY_HASS] = hass
|
||||
app.router.add_get("/", mock_handler)
|
||||
return app
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue