Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a03397-4d51-7fd1-8ff2-946eb22ea2bc
This commit is contained in:
parent
408d32df88
commit
74b2f27997
20 changed files with 608 additions and 182 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import json
|
||||
import sqlite3
|
||||
|
||||
from tamq.store import Store
|
||||
|
||||
|
|
@ -13,3 +14,32 @@ def test_message_history_and_jsonl(tmp_path):
|
|||
assert json.loads(output.read_text())["body"] == "hello"
|
||||
assert store.db.execute("PRAGMA journal_mode").fetchone()[0] == "wal"
|
||||
store.close()
|
||||
|
||||
|
||||
def test_store_migrates_legacy_endpoint_rows_to_manual_delivery(tmp_path):
|
||||
path = tmp_path / "legacy.sqlite3"
|
||||
db = sqlite3.connect(path)
|
||||
db.executescript(
|
||||
"""
|
||||
CREATE TABLE metadata (key TEXT PRIMARY KEY, value TEXT NOT NULL);
|
||||
INSERT INTO metadata VALUES('schema_version', '1');
|
||||
CREATE TABLE endpoints (
|
||||
endpoint_id TEXT PRIMARY KEY,
|
||||
pid INTEGER NOT NULL,
|
||||
session TEXT NOT NULL,
|
||||
repos TEXT NOT NULL,
|
||||
connected_at REAL NOT NULL,
|
||||
disconnected_at REAL
|
||||
);
|
||||
INSERT INTO endpoints VALUES('legacy', 1, 'tamq', '[\"repo\"]', 1, NULL);
|
||||
"""
|
||||
)
|
||||
db.commit()
|
||||
db.close()
|
||||
|
||||
store = Store(path)
|
||||
assert store.endpoints()[0]["delivery_mode"] == "manual"
|
||||
assert store.db.execute(
|
||||
"SELECT value FROM metadata WHERE key='schema_version'"
|
||||
).fetchone()[0] == "2"
|
||||
store.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue