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:
Jc2k 2020-02-25 11:06:35 +00:00 committed by GitHub
parent ba4cc373c8
commit c9d78aa78c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 296 additions and 634 deletions

View file

@ -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