mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Merge pull request #3706 from home-assistant/hotfix-0-29-7b
Fix broken unit tests
This commit is contained in:
commit
9d085a023c
@ -192,8 +192,6 @@ class HomeAssistant(object):
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
self.loop.call_soon(stop_homeassistant)
|
self.loop.call_soon(stop_homeassistant)
|
||||||
self.loop.run_forever()
|
self.loop.run_forever()
|
||||||
finally:
|
|
||||||
self.loop.close()
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_start(self):
|
def async_start(self):
|
||||||
|
@ -78,8 +78,9 @@ def get_test_home_assistant(num_threads=None):
|
|||||||
with patch.object(ha, 'async_create_timer', return_value=None):
|
with patch.object(ha, 'async_create_timer', return_value=None):
|
||||||
with patch.object(ha, 'async_monitor_worker_pool',
|
with patch.object(ha, 'async_monitor_worker_pool',
|
||||||
return_value=None):
|
return_value=None):
|
||||||
orig_start()
|
with patch.object(hass.loop, 'add_signal_handler'):
|
||||||
hass.block_till_done()
|
orig_start()
|
||||||
|
hass.block_till_done()
|
||||||
|
|
||||||
def stop_hass():
|
def stop_hass():
|
||||||
orig_stop()
|
orig_stop()
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
"""Test to verify that Home Assistant core works."""
|
"""Test to verify that Home Assistant core works."""
|
||||||
# pylint: disable=protected-access,too-many-public-methods
|
# pylint: disable=protected-access,too-many-public-methods
|
||||||
# pylint: disable=too-few-public-methods
|
# pylint: disable=too-few-public-methods
|
||||||
import os
|
|
||||||
import signal
|
|
||||||
import unittest
|
import unittest
|
||||||
from unittest.mock import patch, MagicMock
|
from unittest.mock import patch, MagicMock
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
@ -14,8 +12,7 @@ from homeassistant.exceptions import InvalidEntityFormatError
|
|||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
from homeassistant.util.unit_system import (METRIC_SYSTEM)
|
from homeassistant.util.unit_system import (METRIC_SYSTEM)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
__version__, EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP,
|
__version__, EVENT_STATE_CHANGED, ATTR_FRIENDLY_NAME, CONF_UNIT_SYSTEM)
|
||||||
EVENT_STATE_CHANGED, ATTR_FRIENDLY_NAME, CONF_UNIT_SYSTEM)
|
|
||||||
|
|
||||||
from tests.common import get_test_home_assistant
|
from tests.common import get_test_home_assistant
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user