Run asyncio event loop in debug mode during tests (#13058)

* Run asyncio event loop in debug mode during tests

* Remove debug mode again
This commit is contained in:
Paulus Schoutsen 2018-03-11 12:32:12 -07:00 committed by GitHub
parent 26960283a0
commit d0f089975d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 8 deletions

View file

@ -49,8 +49,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up an Arlo IP Camera."""
arlo = hass.data.get(DATA_ARLO)
if not arlo:
@ -60,7 +59,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
for camera in arlo.cameras:
cameras.append(ArloCam(hass, camera, config))
async_add_devices(cameras, True)
add_devices(cameras, True)
class ArloCam(Camera):

View file

@ -229,7 +229,7 @@ class GenericThermostat(ClimateDevice):
"""List of available operation modes."""
return self._operation_list
def set_operation_mode(self, operation_mode):
async def async_set_operation_mode(self, operation_mode):
"""Set operation mode."""
if operation_mode == STATE_HEAT:
self._current_operation = STATE_HEAT

View file

@ -135,7 +135,7 @@ class TestTemplateCover(unittest.TestCase):
entity = self.hass.states.get('cover.test')
attrs = dict()
attrs['position'] = 42
self.hass.states.async_set(
self.hass.states.set(
entity.entity_id, entity.state,
attributes=attrs)
self.hass.block_till_done()
@ -148,7 +148,7 @@ class TestTemplateCover(unittest.TestCase):
self.hass.block_till_done()
entity = self.hass.states.get('cover.test')
attrs['position'] = 0.0
self.hass.states.async_set(
self.hass.states.set(
entity.entity_id, entity.state,
attributes=attrs)
self.hass.block_till_done()

View file

@ -302,7 +302,7 @@ def test_value_discovery_existing_entity(hass, mock_openzwave):
'current_temperature'] is None
def mock_update(self):
self.hass.async_add_job(self.async_update_ha_state)
self.hass.add_job(self.async_update_ha_state)
with patch.object(zwave.node_entity.ZWaveBaseEntity,
'maybe_schedule_update', new=mock_update):
@ -347,7 +347,7 @@ def test_power_schemes(hass, mock_openzwave):
'switch.mock_node_mock_value').attributes
def mock_update(self):
self.hass.async_add_job(self.async_update_ha_state)
self.hass.add_job(self.async_update_ha_state)
with patch.object(zwave.node_entity.ZWaveBaseEntity,
'maybe_schedule_update', new=mock_update):