test: align qdrant ollama verification fixtures
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
from tht.workspace import load_workspace, WorkspaceError
|
||||
from tht.workspace import WorkspaceError, load_workspace
|
||||
|
||||
|
||||
def test_load_workspace_expands_env_vars(monkeypatch, tmp_path):
|
||||
@@ -19,7 +19,7 @@ def test_load_workspace_expands_env_vars(monkeypatch, tmp_path):
|
||||
monkeypatch.setenv("THT_VEC_HOST", "vh")
|
||||
monkeypatch.setenv("THT_VEC_USER", "vu")
|
||||
monkeypatch.setenv("THT_VEC_PASSWORD", "vp")
|
||||
monkeypatch.setenv("THT_OLLAMA_URL", "http://ollama")
|
||||
monkeypatch.setenv("THT_OLLAMA_URL", "http://embedding:11434")
|
||||
monkeypatch.setenv("THT_DOCS_ROOT", str(tmp_path / "docs"))
|
||||
yaml = tmp_path / "w.yaml"
|
||||
yaml.write_text(
|
||||
@@ -49,8 +49,8 @@ def test_load_workspace_expands_env_vars(monkeypatch, tmp_path):
|
||||
" api_key: ${THT_VEC_WRITE_API_KEY}\n"
|
||||
"embeddings:\n"
|
||||
" base_url: ${THT_OLLAMA_URL}\n"
|
||||
" model: nomic-embed-text-v2-moe\n"
|
||||
" dim: 768\n"
|
||||
" model: qwen3-embedding:0.6b\n"
|
||||
" dim: 1024\n"
|
||||
"evidence:\n"
|
||||
" source_root: ${THT_DOCS_ROOT}\n"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user