Add independent Home Assistant addon
This commit is contained in:
21
tests/test_addon_config.py
Normal file
21
tests/test_addon_config.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import yaml # type: ignore[import-untyped]
|
||||
|
||||
|
||||
def test_addon_config_declares_future_addon() -> None:
|
||||
config = yaml.safe_load(Path("addon/config.yaml").read_text(encoding="utf-8"))
|
||||
|
||||
assert config["slug"] == "sillyhome_future"
|
||||
assert config["version"] == "2.0.0-alpha.2"
|
||||
assert config["ingress"] is True
|
||||
assert config["ingress_port"] == 8099
|
||||
assert config["homeassistant_api"] is True
|
||||
|
||||
|
||||
def test_repository_points_to_gitea_repo() -> None:
|
||||
repository = yaml.safe_load(Path("repository.yaml").read_text(encoding="utf-8"))
|
||||
|
||||
assert repository["url"] == "http://192.168.6.31:3000/Otto/sillyhome-future"
|
||||
@@ -15,8 +15,7 @@ def test_health_and_backup_roundtrip(tmp_path, monkeypatch) -> None: # type: ig
|
||||
|
||||
assert stores is not None
|
||||
assert health.status_code == 200
|
||||
assert health.json()["version"] == "2.0.0-alpha.1"
|
||||
assert health.json()["version"] == "2.0.0-alpha.2"
|
||||
assert backup.status_code == 200
|
||||
assert restore.status_code == 200
|
||||
assert restore.json() == {"status": "restored"}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user