1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Add missing type hints to websocket_api (#50915)

This commit is contained in:
Ruslan Sayfutdinov
2021-05-21 17:39:18 +01:00
committed by GitHub
parent dc65f279a7
commit 42ff687c32
11 changed files with 251 additions and 159 deletions

View File

@@ -1,6 +1,7 @@
"""Test WebSocket Connection class."""
import asyncio
import logging
from unittest.mock import Mock
import voluptuous as vol
@@ -8,6 +9,8 @@ from homeassistant import exceptions
from homeassistant.components import websocket_api
from homeassistant.components.websocket_api import const
from tests.common import MockUser
async def test_send_big_result(hass, websocket_client):
"""Test sending big results over the WS."""
@@ -31,8 +34,10 @@ async def test_send_big_result(hass, websocket_client):
async def test_exception_handling():
"""Test handling of exceptions."""
send_messages = []
user = MockUser()
refresh_token = Mock()
conn = websocket_api.ActiveConnection(
logging.getLogger(__name__), None, send_messages.append, None, None
logging.getLogger(__name__), None, send_messages.append, user, refresh_token
)
for (exc, code, err) in (