test: align qdrant ollama verification fixtures

This commit is contained in:
2026-08-08 22:15:02 +02:00
parent ffe0afb6a7
commit 4e810af516
11 changed files with 72 additions and 44 deletions
@@ -1,15 +1,14 @@
from datetime import UTC, datetime
from types import SimpleNamespace
import pytest
import typer
from tht.cli import db_cmd
from tht.cli import db_cmd, memory_cmd
from tht.cli.lsh_cmd import _extract_lsh_values
from tht.memory import MemoryRecord
from tht.mschema.models import Annotations, ColumnPhysical, PhysicalSchema, TablePhysical
from tht.ports.dwh import DistinctValues, DwhHealth
from tht.cli import memory_cmd
from tht.memory import MemoryRecord
from datetime import datetime
def _ping(monkeypatch, health, capsys):
@@ -44,7 +43,7 @@ def test_db_ping_direct_connection_historical_wording(monkeypatch, capsys):
@pytest.mark.parametrize(("limit", "truncated"), [(7, False), (1201, True)])
def test_lsh_extraction_honors_configured_limit(limit, truncated):
physical = PhysicalSchema(database="d", schema="s", introspected_at=datetime(2026, 1, 1), tables={
physical = PhysicalSchema(database="d", schema="s", introspected_at=datetime(2026, 1, 1, tzinfo=UTC), tables={
"t": TablePhysical(columns={"c": ColumnPhysical(type="text", eligible=True)})
})
calls = []
@@ -69,7 +68,7 @@ def test_memory_command_writes_through_factory_vector_store(monkeypatch):
manifest = SimpleNamespace(id="s1")
snapshot = SimpleNamespace(manifest=manifest, decisions=[], artifacts={})
record = MemoryRecord(
id="m1", ts=datetime(2026, 1, 1), session_id="s1",
id="m1", ts=datetime(2026, 1, 1, tzinfo=UTC), session_id="s1",
decision_seq=7, type="concept_clarified", subject="paziente attivo",
detail="flag_attivo = TRUE", question_context="q",
)
@@ -97,7 +96,6 @@ def test_solved_index_writes_through_writer_only_factory_store(monkeypatch):
solved_record = object()
calls = []
monkeypatch.setattr(memory_cmd, "has_vector_write_rest", lambda cfg: True)
monkeypatch.setattr(memory_cmd, "load_snapshot_or_exit", lambda cfg, session: SimpleNamespace(manifest=manifest, decisions=[], artifacts={}))
monkeypatch.setattr(
"tht.adapters.factory.build_vector_store",