refactor(harness): route workflow persistence through repositories
This commit is contained in:
@@ -108,16 +108,12 @@ def test_do_run_offset_zero_path_unchanged(monkeypatch):
|
||||
|
||||
|
||||
def test_preview_session_no_file_resolves_sql_final(monkeypatch, tmp_path, capsys):
|
||||
"""--session without a positional FILE resolves sql_final.sql via _session_sql_file."""
|
||||
"""--session without a positional FILE resolves repository SQL text."""
|
||||
from types import SimpleNamespace
|
||||
|
||||
from tht.cli import sql_cmd
|
||||
|
||||
sql_file = tmp_path / "sql_final.sql"
|
||||
sql_file.write_text("SELECT session_resolved")
|
||||
|
||||
# Patch _session_sql_file to return our tmp file (no real workspace/DB needed).
|
||||
monkeypatch.setattr(sql_cmd, "_session_sql_file", lambda cfg, sid: sql_file)
|
||||
monkeypatch.setattr(sql_cmd, "_session_sql", lambda cfg, sid: "SELECT session_resolved")
|
||||
|
||||
captured_sql = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user