Bootstrap SillyHome Future v2 core
This commit is contained in:
22
tests/test_future_api.py
Normal file
22
tests/test_future_api.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from app.main import app, stores
|
||||
|
||||
|
||||
def test_health_and_backup_roundtrip(tmp_path, monkeypatch) -> None: # type: ignore[no-untyped-def]
|
||||
monkeypatch.setenv("SILLYHOME_FUTURE_STORE", str(tmp_path))
|
||||
client = TestClient(app)
|
||||
|
||||
health = client.get("/health")
|
||||
backup = client.get("/v2/backup/export")
|
||||
restore = client.post("/v2/backup/restore", json=backup.json())
|
||||
|
||||
assert stores is not None
|
||||
assert health.status_code == 200
|
||||
assert health.json()["version"] == "2.0.0-alpha.1"
|
||||
assert backup.status_code == 200
|
||||
assert restore.status_code == 200
|
||||
assert restore.json() == {"status": "restored"}
|
||||
|
||||
Reference in New Issue
Block a user