Add missing mock in filesize config flow tests (#89441)

This commit is contained in:
epenet 2023-03-09 19:04:51 +01:00 committed by GitHub
parent 4e4608183e
commit f3084165b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,8 @@
"""Tests for the Filesize config flow.""" """Tests for the Filesize config flow."""
from unittest.mock import patch from unittest.mock import patch
import pytest
from homeassistant.components.filesize.const import DOMAIN from homeassistant.components.filesize.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import CONF_FILE_PATH from homeassistant.const import CONF_FILE_PATH
@ -11,6 +13,8 @@ from . import TEST_DIR, TEST_FILE, TEST_FILE_NAME, async_create_file
from tests.common import MockConfigEntry from tests.common import MockConfigEntry
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
async def test_full_user_flow(hass: HomeAssistant) -> None: async def test_full_user_flow(hass: HomeAssistant) -> None:
"""Test the full user configuration flow.""" """Test the full user configuration flow."""
@ -75,9 +79,6 @@ async def test_flow_fails_on_validation(hass: HomeAssistant) -> None:
with patch( with patch(
"homeassistant.components.filesize.config_flow.pathlib.Path", "homeassistant.components.filesize.config_flow.pathlib.Path",
), patch(
"homeassistant.components.filesize.async_setup_entry",
return_value=True,
): ):
result2 = await hass.config_entries.flow.async_configure( result2 = await hass.config_entries.flow.async_configure(
result["flow_id"], result["flow_id"],
@ -91,9 +92,6 @@ async def test_flow_fails_on_validation(hass: HomeAssistant) -> None:
hass.config.allowlist_external_dirs = {TEST_DIR} hass.config.allowlist_external_dirs = {TEST_DIR}
with patch( with patch(
"homeassistant.components.filesize.config_flow.pathlib.Path", "homeassistant.components.filesize.config_flow.pathlib.Path",
), patch(
"homeassistant.components.filesize.async_setup_entry",
return_value=True,
): ):
result2 = await hass.config_entries.flow.async_configure( result2 = await hass.config_entries.flow.async_configure(
result["flow_id"], result["flow_id"],