Refactor homekit_controller config flow tests (#32141)
* Config flow test refactor * Add a service and characteristic to the accessory so its more realistic * Feedback from review * Missing apostrophe
This commit is contained in:
6 files changed
+296
-634
No files matched your search
@@ -2,6 +2,8 @@
|
||||
import datetime
|
||||
from unittest import mock
|
||||
|
||||
from aiohomekit.testing import FakeController
|
||||
import asynctest
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -12,3 +14,11 @@ def utcnow(request):
|
||||
with mock.patch("homeassistant.util.dt.utcnow") as dt_utcnow:
|
||||
dt_utcnow.return_value = start_dt
|
||||
yield dt_utcnow
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def controller(hass):
|
||||
"""Replace aiohomekit.Controller with an instance of aiohomekit.testing.FakeController."""
|
||||
instance = FakeController()
|
||||
with asynctest.patch("aiohomekit.Controller", return_value=instance):
|
||||
yield instance
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user