Use asynctest-mock in most places (#35109)

* Use asynctest-mock in most places

* Fix broken patch in pilight
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2020-05-03 11:27:19 -07:00
1 parent e7fc886992
commit 2af984917e
319 files changed
+456 -522

No files matched your search

+2 -2
View File
@@ -1,6 +1,4 @@
"""Fixtures for cloud tests."""
from unittest.mock import patch
import jwt
import pytest
@@ -8,6 +6,8 @@ from homeassistant.components.cloud import const, prefs
from . import mock_cloud, mock_cloud_prefs
from tests.async_mock import patch
@pytest.fixture(autouse=True)
def mock_user_data():
+1 -3
View File
@@ -1,10 +1,8 @@
"""Tests for the cloud binary sensor."""
from unittest.mock import Mock
from homeassistant.components.cloud.const import DISPATCHER_REMOTE_UPDATE
from homeassistant.setup import async_setup_component
from tests.async_mock import patch
from tests.async_mock import Mock, patch
async def test_remote_connection_sensor(hass):
+1 -3
View File
@@ -1,6 +1,4 @@
"""Test the Cloud Google Config."""
from unittest.mock import Mock
from homeassistant.components.cloud import GACTIONS_SCHEMA
from homeassistant.components.cloud.google_config import CloudGoogleConfig
from homeassistant.components.google_assistant import helpers as ga_helpers
@@ -9,7 +7,7 @@ from homeassistant.core import CoreState
from homeassistant.helpers.entity_registry import EVENT_ENTITY_REGISTRY_UPDATED
from homeassistant.util.dt import utcnow
from tests.async_mock import AsyncMock, patch
from tests.async_mock import AsyncMock, Mock, patch
from tests.common import async_fire_time_changed
+2 -2
View File
@@ -1,9 +1,9 @@
"""Test Cloud preferences."""
from unittest.mock import patch
from homeassistant.auth.const import GROUP_ID_ADMIN
from homeassistant.components.cloud.prefs import STORAGE_KEY, CloudPreferences
from tests.async_mock import patch
async def test_set_username(hass):
"""Test we clear config if we set different username."""