mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Add type hints to integration tests (part 19) (#88178)
This commit is contained in:
@ -63,7 +63,7 @@ async def test_config_not_valid_service_names(hass: HomeAssistant) -> None:
|
||||
|
||||
|
||||
@patch("homeassistant.components.shell_command.asyncio.create_subprocess_shell")
|
||||
async def test_template_render_no_template(mock_call, hass):
|
||||
async def test_template_render_no_template(mock_call, hass: HomeAssistant) -> None:
|
||||
"""Ensure shell_commands without templates get rendered properly."""
|
||||
mock_call.return_value = mock_process_creator(error=False)
|
||||
|
||||
@ -83,7 +83,7 @@ async def test_template_render_no_template(mock_call, hass):
|
||||
|
||||
|
||||
@patch("homeassistant.components.shell_command.asyncio.create_subprocess_exec")
|
||||
async def test_template_render(mock_call, hass):
|
||||
async def test_template_render(mock_call, hass: HomeAssistant) -> None:
|
||||
"""Ensure shell_commands with templates get rendered properly."""
|
||||
hass.states.async_set("sensor.test_state", "Works")
|
||||
mock_call.return_value = mock_process_creator(error=False)
|
||||
@ -108,7 +108,7 @@ async def test_template_render(mock_call, hass):
|
||||
|
||||
@patch("homeassistant.components.shell_command.asyncio.create_subprocess_shell")
|
||||
@patch("homeassistant.components.shell_command._LOGGER.error")
|
||||
async def test_subprocess_error(mock_error, mock_call, hass):
|
||||
async def test_subprocess_error(mock_error, mock_call, hass: HomeAssistant) -> None:
|
||||
"""Test subprocess that returns an error."""
|
||||
mock_call.return_value = mock_process_creator(error=True)
|
||||
with tempfile.TemporaryDirectory() as tempdirname:
|
||||
@ -127,7 +127,7 @@ async def test_subprocess_error(mock_error, mock_call, hass):
|
||||
|
||||
|
||||
@patch("homeassistant.components.shell_command._LOGGER.debug")
|
||||
async def test_stdout_captured(mock_output, hass):
|
||||
async def test_stdout_captured(mock_output, hass: HomeAssistant) -> None:
|
||||
"""Test subprocess that has stdout."""
|
||||
test_phrase = "I have output"
|
||||
assert await async_setup_component(
|
||||
@ -144,7 +144,7 @@ async def test_stdout_captured(mock_output, hass):
|
||||
|
||||
|
||||
@patch("homeassistant.components.shell_command._LOGGER.debug")
|
||||
async def test_stderr_captured(mock_output, hass):
|
||||
async def test_stderr_captured(mock_output, hass: HomeAssistant) -> None:
|
||||
"""Test subprocess that has stderr."""
|
||||
test_phrase = "I have error"
|
||||
assert await async_setup_component(
|
||||
|
Reference in New Issue
Block a user