feat(k1): complete canonical control lifecycle
This commit is contained in:
@@ -4,6 +4,7 @@ from typing import Any
|
||||
|
||||
from typer.testing import CliRunner
|
||||
|
||||
from k1link.device_plugins.xgrids_k1 import cli
|
||||
from k1link.device_plugins.xgrids_k1.cli import app
|
||||
|
||||
runner = CliRunner()
|
||||
@@ -25,6 +26,26 @@ def test_doctor_json() -> None:
|
||||
assert any(item["name"] == "tcpdump" for item in payload["tools"])
|
||||
|
||||
|
||||
def test_serve_resolves_frontend_from_repository_root(monkeypatch: Any) -> None:
|
||||
captured: dict[str, object] = {}
|
||||
|
||||
def fake_run(application: str, **kwargs: object) -> None:
|
||||
captured.update({"application": application, **kwargs})
|
||||
|
||||
monkeypatch.setattr(cli.uvicorn, "run", fake_run)
|
||||
|
||||
result = runner.invoke(app, ["serve"])
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert captured == {
|
||||
"application": "k1link.web.app:app",
|
||||
"host": "127.0.0.1",
|
||||
"port": 8000,
|
||||
"log_level": "info",
|
||||
"access_log": True,
|
||||
}
|
||||
|
||||
|
||||
def test_authority_provision_requires_explicit_reviewed_value_confirmation() -> None:
|
||||
result = runner.invoke(app, ["authority", "provision"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user