Fix race condition in template components.

This commit is contained in:
pavoni committed 2016-03-17 12:10:19 +00:00
1 parent 179c6efff7
commit 4e7160139e
4 files changed
+5 -5

No files matched your search

@@ -91,9 +91,9 @@ class TestBinarySensorTemplate(unittest.TestCase):
hass = mock.MagicMock()
vs = template.BinarySensorTemplate(hass, 'parent', 'Parent',
'motion', '{{ 1 > 1 }}')
with mock.patch.object(vs, 'update_ha_state') as mock_update:
with mock.patch.object(vs, '_event_listener') as mock_update:
vs._event_listener(None)
mock_update.assert_called_once_with(True)
assert mock_update.call_count == 1
def test_update(self):
""""Test the update."""