28 lines
896 B
Python
28 lines
896 B
Python
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
sys.path.insert(0, str(ROOT / "active-runtime" / "app"))
|
|
from deployment_state import RuntimeDeploymentState
|
|
from v2r1c6_privacy_tools import health_payload, serve # noqa: E402
|
|
|
|
|
|
def test_health_is_engineering_only() -> None:
|
|
result = health_payload(RuntimeDeploymentState("V2R1C7", "a" * 40, "b" * 64, "STAGED"))
|
|
assert result["status"] == "ok"
|
|
assert result["version"] == "V2R1C7"
|
|
assert result["commit_oid"] == "a" * 40
|
|
assert result["artifact_sha256"] == "b" * 64
|
|
assert result["deployment_state"] == "STAGED"
|
|
assert result["production_deployed"] is False
|
|
assert result["health_timestamp"]
|
|
|
|
|
|
def test_listener_rejects_non_loopback() -> None:
|
|
with pytest.raises(ValueError, match="loopback"):
|
|
serve("0.0.0.0", 18926)
|