@@ -94,7 +94,12 @@ async def test_get_resource_handler_wrong_version(
9494 caplog : pytest .LogCaptureFixture ,
9595) -> None :
9696 """Test the resource handler with wrong storage version."""
97- hass .data ["lovelace" ]["resources" ].store .version = 2
97+ try :
98+ hass .data ["lovelace" ].resources .store .version = 2
99+ except AttributeError :
100+ # Changed to 2025.2.0
101+ # Changed in https://github.com/home-assistant/core/pull/136313
102+ hass .data ["lovelace" ]["resources" ].store .version = 2
98103 resources = downloaded_plugin_repository ._get_resource_handler ()
99104 assert resources is None
100105 assert "Can not use the dashboard resources" in caplog .text
@@ -106,7 +111,13 @@ async def test_get_resource_handler_wrong_key(
106111 caplog : pytest .LogCaptureFixture ,
107112) -> None :
108113 """Test the resource handler with wrong storage key."""
109- hass .data ["lovelace" ]["resources" ].store .key = "wrong_key"
114+ try :
115+ hass .data ["lovelace" ].resources .store .key = "wrong_key"
116+ except AttributeError :
117+ # Changed to 2025.2.0
118+ # Changed in https://github.com/home-assistant/core/pull/136313
119+ hass .data ["lovelace" ]["resources" ].store .key = "wrong_key"
120+
110121 resources = downloaded_plugin_repository ._get_resource_handler ()
111122 assert resources is None
112123 assert "Can not use the dashboard resources" in caplog .text
@@ -118,7 +129,13 @@ async def test_get_resource_handler_none_store(
118129 caplog : pytest .LogCaptureFixture ,
119130) -> None :
120131 """Test the resource handler with store being none."""
121- hass .data ["lovelace" ]["resources" ].store = None
132+ try :
133+
134+ hass .data ["lovelace" ].resources .store = None
135+ except AttributeError :
136+ # Changed to 2025.2.0
137+ # Changed in https://github.com/home-assistant/core/pull/136313
138+ hass .data ["lovelace" ]["resources" ].store = None
122139 resources = downloaded_plugin_repository ._get_resource_handler ()
123140 assert resources is None
124141 assert "YAML mode detected, can not update resources" in caplog .text
@@ -130,7 +147,13 @@ async def test_get_resource_handler_no_store(
130147 caplog : pytest .LogCaptureFixture ,
131148) -> None :
132149 """Test the resource handler with no store."""
133- del hass .data ["lovelace" ]["resources" ].store
150+ try :
151+ hass .data ["lovelace" ].resources .store = None
152+ except AttributeError :
153+ # Changed to 2025.2.0
154+ # Changed in https://github.com/home-assistant/core/pull/136313
155+ del hass .data ["lovelace" ]["resources" ].store
156+
134157 resources = downloaded_plugin_repository ._get_resource_handler ()
135158 assert resources is None
136159 assert "YAML mode detected, can not update resources" in caplog .text
@@ -142,7 +165,12 @@ async def test_get_resource_handler_no_lovelace_resources(
142165 caplog : pytest .LogCaptureFixture ,
143166) -> None :
144167 """Test the resource handler with no lovelace resources."""
145- del hass .data ["lovelace" ]["resources" ]
168+ try :
169+ hass .data ["lovelace" ].resources = None
170+ except AttributeError :
171+ # Changed to 2025.2.0
172+ # Changed in https://github.com/home-assistant/core/pull/136313
173+ del hass .data ["lovelace" ]["resources" ]
146174 resources = downloaded_plugin_repository ._get_resource_handler ()
147175 assert resources is None
148176 assert "Can not access the dashboard resources" in caplog .text
0 commit comments