Cleanup async handling (#6388)
* Cleanups unneeded blocks * Cleanup bootstrap * dedicated update_ha_state * Fix imap_email_content * fx tests * Fix lint & spell
This commit is contained in:
1 parent
3044aecbe9
commit
8232f1ef65
30 files changed
+124
-108
No files matched your search
@@ -77,7 +77,8 @@ class TestHelpersEntity(object):
|
||||
self.entity = entity.Entity()
|
||||
self.entity.entity_id = 'test.overwrite_hidden_true'
|
||||
self.hass = self.entity.hass = get_test_home_assistant()
|
||||
self.entity.update_ha_state()
|
||||
self.entity.schedule_update_ha_state()
|
||||
self.hass.block_till_done()
|
||||
|
||||
def teardown_method(self, method):
|
||||
"""Stop everything that was started."""
|
||||
@@ -92,7 +93,8 @@ class TestHelpersEntity(object):
|
||||
"""Test we can overwrite hidden property to True."""
|
||||
self.hass.data[DATA_CUSTOMIZE] = EntityValues({
|
||||
self.entity.entity_id: {ATTR_HIDDEN: True}})
|
||||
self.entity.update_ha_state()
|
||||
self.entity.schedule_update_ha_state()
|
||||
self.hass.block_till_done()
|
||||
|
||||
state = self.hass.states.get(self.entity.entity_id)
|
||||
assert state.attributes.get(ATTR_HIDDEN)
|
||||
@@ -126,6 +128,7 @@ class TestHelpersEntity(object):
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) is None
|
||||
with patch('homeassistant.helpers.entity.Entity.device_class',
|
||||
new='test_class'):
|
||||
self.entity.update_ha_state()
|
||||
self.entity.schedule_update_ha_state()
|
||||
self.hass.block_till_done()
|
||||
state = self.hass.states.get(self.entity.entity_id)
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == 'test_class'
|
||||
Reference in new issue
Block a user