Add type hints to integration tests (part 8) (#87982)

This commit is contained in:
epenet 2023-02-13 11:13:48 +01:00 committed by GitHub
parent 575f7c4205
commit 89e4ee5320
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 696 additions and 339 deletions

View file

@ -219,7 +219,7 @@ async def test_config_local_sdk_if_ssl_enabled(
assert await resp.read() == b""
async def test_agent_user_id_storage(hass, hass_storage):
async def test_agent_user_id_storage(hass: HomeAssistant, hass_storage) -> None:
"""Test a disconnect message."""
hass_storage["google_assistant"] = {
@ -302,7 +302,7 @@ async def test_agent_user_id_connect() -> None:
@pytest.mark.parametrize("agents", [{}, {"1"}, {"1", "2"}])
async def test_report_state_all(agents):
async def test_report_state_all(agents) -> None:
"""Test a disconnect message."""
config = MockConfig(agent_user_ids=agents)
data = {}
@ -315,7 +315,7 @@ async def test_report_state_all(agents):
"agents, result",
[({}, 204), ({"1": 200}, 200), ({"1": 200, "2": 300}, 300)],
)
async def test_sync_entities_all(agents, result):
async def test_sync_entities_all(agents, result) -> None:
"""Test sync entities ."""
config = MockConfig(agent_user_ids=set(agents.keys()))
with patch.object(
@ -328,7 +328,7 @@ async def test_sync_entities_all(agents, result):
assert res == result
def test_supported_features_string(caplog):
def test_supported_features_string(caplog: pytest.LogCaptureFixture) -> None:
"""Test bad supported features."""
entity = helpers.GoogleEntity(
None,
@ -353,7 +353,11 @@ def test_request_data() -> None:
assert data.is_local_request is False
async def test_config_local_sdk_allow_min_version(hass, hass_client, caplog):
async def test_config_local_sdk_allow_min_version(
hass: HomeAssistant,
hass_client: ClientSessionGenerator,
caplog: pytest.LogCaptureFixture,
) -> None:
"""Test the local SDK."""
version = str(helpers.LOCAL_SDK_MIN_VERSION)
assert await async_setup_component(hass, "webhook", {})
@ -393,7 +397,12 @@ async def test_config_local_sdk_allow_min_version(hass, hass_client, caplog):
@pytest.mark.parametrize("version", (None, "2.1.4"))
async def test_config_local_sdk_warn_version(hass, hass_client, caplog, version):
async def test_config_local_sdk_warn_version(
hass: HomeAssistant,
hass_client: ClientSessionGenerator,
caplog: pytest.LogCaptureFixture,
version,
) -> None:
"""Test the local SDK."""
assert await async_setup_component(hass, "webhook", {})