test(log_management_refresh): use rfind() to locate code (Phase 5.2, fixes 1 pre-existing failure)
The test used src.find() which locates the first occurrence of
'Refresh Registry' in the comment block (line 2090 in src/gui_2.py),
not the actual code (line 2111). The 400-char snippet window doesn't
reach the code, so the assertion for 'load_registry' fails.
Production code is already correct (in-place load_registry()) at
src/gui_2.py:2111-2112 (user commit df7bda6e). This test just needs
to use rfind() to locate the actual code, not the comment.
Change: src.find(marker) -> src.rfind(marker)
1 test passes (was 1 pre-existing failure).
This commit is contained in:
@@ -4,7 +4,7 @@ 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)
|
||||
idx = src.rfind(marker)
|
||||
assert idx != -1, "Could not find Refresh Registry button in gui_2.py"
|
||||
snippet = src[idx:idx + 400]
|
||||
assert "load_registry" in snippet, (
|
||||
|
||||
Reference in New Issue
Block a user