history allowed to load states with invalid entity IDs (#20399)

This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2019-01-24 17:53:01 -08:00
1 parent c508ba166c
commit c7f5beb794
3 files changed
+17 -2

No files matched your search

+9
View File
@@ -142,3 +142,12 @@ class TestRecorderRuns(unittest.TestCase):
assert sorted(run.entity_ids()) == ['sensor.humidity', 'sensor.lux']
assert run.entity_ids(in_run2) == ['sensor.humidity']
def test_states_from_native_invalid_entity_id():
"""Test loading a state from an invalid entity ID."""
event = States()
event.entity_id = "test.invalid__id"
event.attributes = "{}"
state = event.to_native()
assert state.entity_id == 'test.invalid__id'