Add and restore context in recorder (#15859)

This commit is contained in:
Paulus Schoutsen 2018-08-10 18:09:01 +02:00 committed by GitHub
parent da916d7b27
commit 9512bb9587
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 73 additions and 14 deletions

View file

@ -246,8 +246,9 @@ class TestEvent(unittest.TestCase):
"""Test events."""
now = dt_util.utcnow()
data = {'some': 'attr'}
context = ha.Context()
event1, event2 = [
ha.Event('some_type', data, time_fired=now)
ha.Event('some_type', data, time_fired=now, context=context)
for _ in range(2)
]