Add homekit_controller tests (#20457)

* Add a test for a homekit_controller switch

* Add a test for a homekit_controller lightbulb

* Add a test for homekit_controller thermostat

* Changes from review

* Patch utcnow to known time in HK tests

* Neater fixture use per review
This commit is contained in:
Jc2k 2019-01-27 11:34:49 +00:00 committed by Martin Hjelmare
parent 7368c623d4
commit 10e3698fd7
9 changed files with 343 additions and 5 deletions

View file

@ -0,0 +1,14 @@
"""HomeKit controller session fixtures."""
import datetime
from unittest import mock
import pytest
@pytest.fixture
def utcnow(request):
"""Freeze time at a known point."""
start_dt = datetime.datetime(2019, 1, 1, 0, 0, 0)
with mock.patch('homeassistant.util.dt.utcnow') as dt_utcnow:
dt_utcnow.return_value = start_dt
yield dt_utcnow