test(cli): sessions open-failure test creates the store so the read-only empty path does not short-circuit

This commit is contained in:
teknium1
2026-09-15 03:38:37 -07:00
committed by Teknium
parent 7c6b29e1e4
commit 2500f4ee56
@@ -105,6 +105,12 @@ def test_sessions_db_open_failure_points_to_repair(monkeypatch, capsys):
raise RuntimeError("database disk image is malformed")
monkeypatch.setattr("hermes_state.SessionDB", _Boom)
import hermes_state
# `list` is read-only: a missing store prints "empty" instead; make the file exist so the
# open failure is the real corrupt-database case this copy is for.
db_path = hermes_state._default_db_path()
db_path.parent.mkdir(parents=True, exist_ok=True)
db_path.write_bytes(b"not a database")
import argparse
parser = argparse.ArgumentParser()
args = argparse.Namespace(sessions_action="list", session_id=None)