import inspect import sys import os # Ensure project root is in path sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) try: from src.gui_2 import App, render_discussion_entry, render_thinking_trace import src.gui_2 except ImportError as e: print(f"FAILURE: Could not import from src.gui_2: {e}") sys.exit(1) def test_gui_monolithic_symbols(): # Verify App is importable assert App is not None # Verify render_discussion_entry is in src.gui_2 assert hasattr(src.gui_2, 'render_discussion_entry'), "render_discussion_entry missing from src.gui_2" # Verify it's defined in src.gui_2, not imported mod = inspect.getmodule(render_discussion_entry) assert mod is not None, "Could not determine module for render_discussion_entry" assert mod.__name__ == 'src.gui_2', f"render_discussion_entry expected in src.gui_2, but found in {mod.__name__}" # Verify render_thinking_trace is in src.gui_2 assert hasattr(src.gui_2, 'render_thinking_trace'), "render_thinking_trace missing from src.gui_2" # Verify it's defined in src.gui_2, not imported mod = inspect.getmodule(render_thinking_trace) assert mod is not None, "Could not determine module for render_thinking_trace" assert mod.__name__ == 'src.gui_2', f"render_thinking_trace expected in src.gui_2, but found in {mod.__name__}" if __name__ == "__main__": try: test_gui_monolithic_symbols() print("SUCCESS: Symbols are correctly defined in src.gui_2 local namespace.") except AssertionError as e: print(f"FAILURE: {e}") sys.exit(1) except Exception as e: print(f"ERROR: {e}") sys.exit(1)