Private
Public Access
0
0
Files
manual_slop/tests/test_log_management_refresh.py
T
ed 8fac9c34c9 fix(log): Refresh Registry button now calls load_registry() on the live instance
ROOT CAUSE: gui_2.py:1675 re-instantiated LogRegistry() which opens the TOML
but never called .load_registry() so the table stayed empty.

FIX: in-place load_registry() on the existing instance — preserves in-memory
state (any pending update_session_metadata call) and matches the user's intent
of 'refresh from disk'.
2026-06-03 11:28:36 -04:00

18 lines
644 B
Python

import inspect
from src import gui_2
def test_refresh_registry_button_calls_load_registry():
src = inspect.getsource(gui_2)
marker = "Refresh Registry"
idx = src.find(marker)
assert idx != -1, "Could not find Refresh Registry button in gui_2.py"
snippet = src[idx:idx + 400]
assert "load_registry" in snippet, (
"Refresh Registry button must invoke load_registry(); "
"currently it only re-instantiates LogRegistry which leaves .data empty."
)
assert snippet.count("log_registry.LogRegistry(") <= 1, (
"Refresh Registry button should not re-instantiate LogRegistry. "
"Prefer in-place load_registry() on the live instance."
)