mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-09 02:49:43 +00:00
Update to python 3.11 (#4296)
This commit is contained in:
20
tests/homeassistant/test_module.py
Normal file
20
tests/homeassistant/test_module.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""Test Homeassistant module."""
|
||||
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
from supervisor.coresys import CoreSys
|
||||
from supervisor.docker.interface import DockerInterface
|
||||
|
||||
|
||||
async def test_load(coresys: CoreSys, tmp_supervisor_data: Path):
|
||||
"""Test homeassistant module load."""
|
||||
with open(tmp_supervisor_data / "homeassistant" / "secrets.yaml", "w") as secrets:
|
||||
secrets.write("hello: world\n")
|
||||
|
||||
with patch.object(DockerInterface, "attach") as attach:
|
||||
await coresys.homeassistant.load()
|
||||
|
||||
attach.assert_called_once()
|
||||
|
||||
assert coresys.homeassistant.secrets.secrets == {"hello": "world"}
|
||||
Reference in New Issue
Block a user