mirror of
https://github.com/home-assistant/core.git
synced 2025-12-25 05:26:47 +00:00
Move imports to top for notion (#29539)
* Move imports to top for notion * Fix mocking library in test_config_flow.py
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
"""Define tests for the Notion config flow."""
|
||||
import aionotion
|
||||
from unittest.mock import patch
|
||||
import pytest
|
||||
|
||||
from homeassistant import data_entry_flow
|
||||
from homeassistant.components.notion import DOMAIN, config_flow
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||
|
||||
from tests.common import MockConfigEntry, MockDependency, mock_coro
|
||||
from tests.common import MockConfigEntry, mock_coro
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -18,8 +19,8 @@ def mock_client_coro():
|
||||
@pytest.fixture
|
||||
def mock_aionotion(mock_client_coro):
|
||||
"""Mock the aionotion library."""
|
||||
with MockDependency("aionotion") as mock_:
|
||||
mock_.async_get_client.return_value = mock_client_coro
|
||||
with patch("homeassistant.components.notion.config_flow.async_get_client") as mock_:
|
||||
mock_.return_value = mock_client_coro
|
||||
yield mock_
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user