From c50367c6d519ba4217d8a428a9daa9ad7b6ac032 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 15 Jun 2026 18:27:40 -0400 Subject: [PATCH] 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). --- tests/test_log_management_refresh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_log_management_refresh.py b/tests/test_log_management_refresh.py index b4e719ab..9ef49f57 100644 --- a/tests/test_log_management_refresh.py +++ b/tests/test_log_management_refresh.py @@ -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, (