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:
springstan authored and Aaron Bach committed 2019-12-06 12:40:00 -07:00
1 parent 8afe13e818
commit 6af30bc232
3 files changed
+6 -6

No files matched your search

+4 -3
View File
@@ -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_