test: verify portable workspace registry end to end

This commit is contained in:
2026-08-04 08:42:33 +02:00
parent 3d5d26c20c
commit 8b046f9fb2
9 changed files with 143 additions and 2 deletions
+4
View File
@@ -291,6 +291,10 @@ def test_cli_documents_json(tmp_path, monkeypatch):
m = create_session("q", _db(), tmp_path)
from tht.cli import session_cmd
# The CLI resolves its local principal through THT_HOME. Keep this test hermetic instead
# of changing the developer's real identity directory while exercising JSON output.
monkeypatch.setenv("THT_HOME", str(tmp_path / "thoth-home"))
class FakePaths:
sessions = tmp_path
+4 -1
View File
@@ -142,6 +142,8 @@ def _list_sessions(sessions_root: Path) -> list[dict]:
"name": m.name,
"group": m.group,
"archived": m.archived,
"workspace_id": m.workspace_id,
"workspace_revision": m.workspace_revision,
})
out.sort(key=lambda r: r["created_at"], reverse=True)
return out
@@ -159,7 +161,8 @@ def list_cmd(
"summary": s.manifest.summary, "created_at": s.manifest.created_at.isoformat(),
"updated_at": s.manifest.updated_at.isoformat() if s.manifest.updated_at else None,
"author": s.manifest.author, "name": s.manifest.name, "group": s.manifest.group,
"archived": s.manifest.archived}
"archived": s.manifest.archived, "workspace_id": s.manifest.workspace_id,
"workspace_revision": s.manifest.workspace_revision}
for s in session_repository(cfg).list()
]
if json_out: