Add and restore context in recorder (#15859)
This commit is contained in:
1 parent
da916d7b27
commit
9512bb9587
7 files changed
+73
-14
No files matched your search
@@ -60,7 +60,7 @@ class TestStates(unittest.TestCase):
|
||||
'entity_id': 'sensor.temperature',
|
||||
'old_state': None,
|
||||
'new_state': state,
|
||||
})
|
||||
}, context=state.context)
|
||||
assert state == States.from_event(event).to_native()
|
||||
|
||||
def test_from_event_to_delete_state(self):
|
||||
|
||||
@@ -83,9 +83,10 @@ class TestComponentHistory(unittest.TestCase):
|
||||
self.wait_recording_done()
|
||||
|
||||
# Get states returns everything before POINT
|
||||
self.assertEqual(states,
|
||||
sorted(history.get_states(self.hass, future),
|
||||
key=lambda state: state.entity_id))
|
||||
for state1, state2 in zip(
|
||||
states, sorted(history.get_states(self.hass, future),
|
||||
key=lambda state: state.entity_id)):
|
||||
assert state1 == state2
|
||||
|
||||
# Test get_state here because we have a DB setup
|
||||
self.assertEqual(
|
||||
|
||||
Reference in new issue
Block a user