File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed
Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 3636)
3737
3838PATH_VARIABLES = {
39- "site-packages" : next (filter (lambda x : x .endswith ("site-packages" ), sys .path )),
39+ "site-packages" : next (
40+ filter (
41+ lambda x : x .split (os .path .sep )[- 1 ] == "site-packages" and os .path .isdir (x ),
42+ sys .path ,
43+ )
44+ ),
4045 "homeassistant" : os .path .dirname (homeassistant .__file__ ),
4146}
4247
Original file line number Diff line number Diff line change 44import datetime
55import os
66import tempfile
7+ import yaml
78from unittest .mock import AsyncMock , patch
89
910import voluptuous as vol
@@ -299,15 +300,15 @@ async def test_expand_path_config(
299300 """Test configuration with variables."""
300301 await async_setup (
301302 hass ,
302- {
303- CONF_FILES : [
304- {
305- CONF_NAME : " __init__.py" ,
306- CONF_BASE : "{site-packages}/aiofiles" ,
307- CONF_DESTINATION : "{site-packages}/aiofiles" ,
308- CONF_PATCH : "{site-packages}/aiofiles" ,
309- }
310- ]
311- } ,
303+ yaml . load (
304+ """
305+ files:
306+ - name: __init__.py
307+ base : "{site-packages}/aiofiles"
308+ destination : "{site-packages}/aiofiles"
309+ patch : "{site-packages}/aiofiles"
310+ """ ,
311+ Loader = yaml . SafeLoader ,
312+ ) ,
312313 )
313314 await async_next_day (hass , freezer )
You can’t perform that action at this time.
0 commit comments