Add type hints to integration tests (part 23) (#88235)

This commit is contained in:
epenet 2023-02-17 16:40:46 +01:00 committed by GitHub
parent aa50096a31
commit 9a5f88f55f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 651 additions and 408 deletions

View file

@ -40,7 +40,7 @@ def setup_comp(hass):
@patch(scanner_path, return_value=MagicMock(spec=UnifiDeviceScanner))
async def test_get_scanner(unifi_mock, hass):
async def test_get_scanner(unifi_mock, hass: HomeAssistant) -> None:
"""Test creating an Unifi direct scanner with a password."""
conf_dict = {
DOMAIN: {
@ -62,7 +62,7 @@ async def test_get_scanner(unifi_mock, hass):
@patch("pexpect.pxssh.pxssh")
async def test_get_device_name(mock_ssh, hass):
async def test_get_device_name(mock_ssh, hass: HomeAssistant) -> None:
"""Testing MAC matching."""
conf_dict = {
DOMAIN: {
@ -85,7 +85,7 @@ async def test_get_device_name(mock_ssh, hass):
@patch("pexpect.pxssh.pxssh.logout")
@patch("pexpect.pxssh.pxssh.login")
async def test_failed_to_log_in(mock_login, mock_logout, hass):
async def test_failed_to_log_in(mock_login, mock_logout, hass: HomeAssistant) -> None:
"""Testing exception at login results in False."""
from pexpect import exceptions
@ -110,7 +110,9 @@ async def test_failed_to_log_in(mock_login, mock_logout, hass):
@patch("pexpect.pxssh.pxssh.login", autospec=True)
@patch("pexpect.pxssh.pxssh.prompt")
@patch("pexpect.pxssh.pxssh.sendline")
async def test_to_get_update(mock_sendline, mock_prompt, mock_login, mock_logout, hass):
async def test_to_get_update(
mock_sendline, mock_prompt, mock_login, mock_logout, hass: HomeAssistant
) -> None:
"""Testing exception in get_update matching."""
conf_dict = {
DOMAIN: {