import pytest
import src.gui_2 as gui_2
from src.gui_2 import App

def test_rag_panel_exists():
 """Verify that render_rag_panel exists as a module-level function."""
 assert hasattr(gui_2, 'render_rag_panel'), "gui_2 module must have render_rag_panel function"
 assert callable(gui_2.render_rag_panel)

def test_rag_panel_integration():
 """Verify that render_ai_settings_hub calls render_rag_panel by inspecting source."""
 import inspect
 source = inspect.getsource(gui_2.render_ai_settings_hub)
 assert "render_rag_panel(app)" in source
 assert "imgui.collapsing_header(\"RAG Settings\")" in source
