Cleanup coroutine threadsafe (#27080)
* Cleanup coroutine threadsafe * fix lint * Fix typing * Fix tests * Fix black
This commit is contained in:
1 parent
f4a1f2809b
commit
c1851a2d94
23 files changed
+196
-232
No files matched your search
@@ -1,4 +1,5 @@
|
||||
"""The tests for the notify.group platform."""
|
||||
import asyncio
|
||||
import unittest
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
@@ -6,7 +7,6 @@ from homeassistant.setup import setup_component
|
||||
import homeassistant.components.notify as notify
|
||||
import homeassistant.components.group.notify as group
|
||||
import homeassistant.components.demo.notify as demo
|
||||
from homeassistant.util.async_ import run_coroutine_threadsafe
|
||||
|
||||
from tests.common import assert_setup_component, get_test_home_assistant
|
||||
|
||||
@@ -43,7 +43,7 @@ class TestNotifyGroup(unittest.TestCase):
|
||||
},
|
||||
)
|
||||
|
||||
self.service = run_coroutine_threadsafe(
|
||||
self.service = asyncio.run_coroutine_threadsafe(
|
||||
group.async_get_service(
|
||||
self.hass,
|
||||
{
|
||||
@@ -70,7 +70,7 @@ class TestNotifyGroup(unittest.TestCase):
|
||||
|
||||
def test_send_message_with_data(self):
|
||||
"""Test sending a message with to a notify group."""
|
||||
run_coroutine_threadsafe(
|
||||
asyncio.run_coroutine_threadsafe(
|
||||
self.service.async_send_message(
|
||||
"Hello", title="Test notification", data={"hello": "world"}
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user