@@ -591,9 +591,45 @@ def test_component_body_search_types_lockstep() -> None:
591591@pytest .mark .parametrize (
592592 ("attributes" , "expected" ),
593593 [
594- ({"group_entities" : ["light.two" , "light.one" ]}, ["light.one" , "light.two" ]),
594+ (
595+ {
596+ "group_entities" : ["light.two" , "light.one" , "light.two" ],
597+ "entity_id" : ["light.legacy" ],
598+ },
599+ ["light.one" , "light.two" ],
600+ ),
601+ ({"entity_id" : ("light.two" , "light.one" )}, ["light.one" , "light.two" ]),
595602 ({"group_entities" : [], "entity_id" : ["light.legacy" ]}, []),
596603 ({"entity_id" : "light.reference" }, None ),
604+ ({"entity_id" : b"light.reference" }, None ),
605+ ({"entity_id" : bytearray (b"light.reference" )}, None ),
606+ ({"group_entities" : {"light.member" : True }}, None ),
607+ (
608+ {"group_entities" : frozenset ({"light.two" , "light.one" })},
609+ ["light.one" , "light.two" ],
610+ ),
611+ ({"entity_id" : ["light.Not_Valid" ]}, None ),
612+ ({"entity_id" : ["light.not-valid" ]}, None ),
613+ ({"entity_id" : ["light.lämp" ]}, None ),
614+ ({"group_entities" : ["light.valid" , "not-an-entity" ]}, None ),
615+ (
616+ {
617+ "group_entities" : ["light.valid" , "not-an-entity" ],
618+ "entity_id" : ["light.legacy" ],
619+ },
620+ ["light.legacy" ],
621+ ),
622+ (
623+ {
624+ "group_entities" : ["light.modern" ],
625+ "entity_id" : ["light.legacy" ],
626+ },
627+ ["light.modern" ],
628+ ),
629+ (
630+ {"group_entities" : ["light.group" , "light.member" ]},
631+ ["light.group" , "light.member" ],
632+ ),
597633 ({"group_members" : ["light.not_supported" ]}, None ),
598634 ],
599635)
@@ -604,7 +640,7 @@ def test_component_body_search_types_lockstep() -> None:
604640def test_membership_normalizer_artifacts_remain_in_lockstep (
605641 normalizer , attributes , expected
606642) -> None :
607- """Keep server and component normalization aligned across edge cases."""
643+ """Keep server and component normalization aligned across all edge cases."""
608644 assert normalizer (attributes ) == expected
609645
610646
0 commit comments