feat: harden runtime readiness and session workflow
This commit is contained in:
@@ -11,6 +11,7 @@ import json
|
||||
from typer.testing import CliRunner
|
||||
|
||||
from tht.cli import app
|
||||
from tht.ports.vector import VectorReadUnavailable
|
||||
from tht.vectorstore.rest_client import VectorRestError
|
||||
from tht.vectorstore.store import VectorHit
|
||||
|
||||
@@ -39,6 +40,19 @@ def test_solved_search_degrades_when_vectordb_unreachable(tmp_path, monkeypatch)
|
||||
assert "exemplar non disponibili" in res.stderr
|
||||
|
||||
|
||||
def test_solved_search_degrades_direct_vector_read_error(tmp_path, monkeypatch):
|
||||
def boom(cfg):
|
||||
raise VectorReadUnavailable("Vector read operation unavailable")
|
||||
|
||||
monkeypatch.setattr("tht.cli.vector_cmd.open_searcher", boom)
|
||||
res = CliRunner().invoke(
|
||||
app, ["memory", "solved-search", "quante ablazioni", "--json", "-c", str(_cfg(tmp_path))]
|
||||
)
|
||||
assert res.exit_code == 0, res.output
|
||||
assert json.loads(res.stdout) == []
|
||||
assert "exemplar non disponibili" in res.stderr
|
||||
|
||||
|
||||
def test_solved_search_degrades_human_mode(tmp_path, monkeypatch):
|
||||
def boom(cfg):
|
||||
raise VectorRestError("Vector REST non raggiungibile")
|
||||
|
||||
Reference in New Issue
Block a user