1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 20:35:55 +00:00

Make api soon available (#2119)

* Make api soon available

* add more tests
This commit is contained in:
Pascal Vizeli
2020-10-12 15:56:29 +02:00
committed by GitHub
parent ccb8e5fe06
commit 0f60fdd20b
7 changed files with 112 additions and 30 deletions

View File

@@ -1,4 +1,5 @@
"""Common test functions."""
from pathlib import Path
from unittest.mock import MagicMock, PropertyMock, patch
from uuid import uuid4
@@ -164,3 +165,12 @@ def store_manager(coresys: CoreSys):
sm_obj.repositories = set(coresys.config.addons_repositories)
with patch("supervisor.store.data.StoreData.update", return_value=MagicMock()):
yield sm_obj
@pytest.fixture
def run_dir(tmp_path):
"""Fixture to inject hassio env."""
with patch("supervisor.core.RUN_SUPERVISOR_STATE") as mock_run:
tmp_state = Path(tmp_path, "supervisor")
mock_run.write_text = tmp_state.write_text
yield tmp_state