Strengthen config-load assertions
This commit is contained in:
parent
1bf2505093
commit
c1932e22e5
2 changed files with 5 additions and 3 deletions
|
|
@ -37,6 +37,8 @@ async def apply_migrations(conn: aiosqlite.Connection) -> int:
|
|||
else:
|
||||
current = row[0]
|
||||
if current < SCHEMA_VERSION: # pragma: no cover - no migrations yet
|
||||
# No diff migrations exist yet — future versions add UPDATE/ALTER
|
||||
# statements between here and the version bump.
|
||||
await _exec(conn, "UPDATE schema_version SET version = ?", SCHEMA_VERSION)
|
||||
|
||||
await conn.commit()
|
||||
|
|
|
|||
|
|
@ -121,16 +121,16 @@ def test_load_config_with_explicit_path(tmp_path):
|
|||
config_file.write_text("embeddings:\n model:\n provider: ollama\n")
|
||||
|
||||
config = _load_config_with_override(config_file)
|
||||
assert config is not None
|
||||
assert config.embeddings.model.provider == "ollama"
|
||||
|
||||
|
||||
def test_load_config_falls_back_to_default(monkeypatch):
|
||||
from haiku.rag.ingester.cli import _load_config_with_override
|
||||
from haiku.rag.ingester.cli import _load_config_with_override, get_config
|
||||
|
||||
monkeypatch.setattr("haiku.rag.ingester.cli.find_config_file", lambda _: None)
|
||||
|
||||
config = _load_config_with_override(None)
|
||||
assert config is not None
|
||||
assert config == get_config()
|
||||
|
||||
|
||||
# --- cli() entry point ---
|
||||
|
|
|
|||
Loading…
Reference in a new issue