mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Migrate google_* tests from coroutine to async/await (#30377)
This commit is contained in:
committed by
Andrew Sayre
parent
bcb47dab45
commit
37d1771400
@@ -1,6 +1,4 @@
|
||||
"""The tests for google-assistant init."""
|
||||
import asyncio
|
||||
|
||||
from homeassistant.components import google_assistant as ga
|
||||
from homeassistant.core import Context
|
||||
from homeassistant.setup import async_setup_component
|
||||
@@ -8,19 +6,18 @@ from homeassistant.setup import async_setup_component
|
||||
GA_API_KEY = "Agdgjsj399sdfkosd932ksd"
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def test_request_sync_service(aioclient_mock, hass):
|
||||
async def test_request_sync_service(aioclient_mock, hass):
|
||||
"""Test that it posts to the request_sync url."""
|
||||
aioclient_mock.post(ga.const.REQUEST_SYNC_BASE_URL, status=200)
|
||||
|
||||
yield from async_setup_component(
|
||||
await async_setup_component(
|
||||
hass,
|
||||
"google_assistant",
|
||||
{"google_assistant": {"project_id": "test_project", "api_key": GA_API_KEY}},
|
||||
)
|
||||
|
||||
assert aioclient_mock.call_count == 0
|
||||
yield from hass.services.async_call(
|
||||
await hass.services.async_call(
|
||||
ga.const.DOMAIN,
|
||||
ga.const.SERVICE_REQUEST_SYNC,
|
||||
blocking=True,
|
||||
|
||||
Reference in New Issue
Block a user