Test RAG class integration with different embedders.
| 293 | |
| 294 | |
| 295 | class TestRAGIntegration: |
| 296 | """Test RAG class integration with different embedders.""" |
| 297 | |
| 298 | def test_rag_initialization(self): |
| 299 | """Test RAG initialization with different embedder configurations.""" |
| 300 | from api.rag import RAG |
| 301 | |
| 302 | # Test with default configuration |
| 303 | try: |
| 304 | rag = RAG(provider="google", model="gemini-1.5-flash") |
| 305 | assert rag is not None, "RAG should be initialized" |
| 306 | assert hasattr(rag, 'embedder'), "RAG should have embedder" |
| 307 | assert hasattr(rag, 'is_ollama_embedder'), "RAG should have is_ollama_embedder attribute" |
| 308 | except Exception as e: |
| 309 | logger.warning(f"RAG initialization failed (might be expected if keys missing): {e}") |
| 310 | |
| 311 | def test_rag_embedder_type_detection(self): |
| 312 | """Test that RAG correctly detects embedder type.""" |
| 313 | from api.rag import RAG |
| 314 | |
| 315 | try: |
| 316 | rag = RAG() |
| 317 | # Should have the embedder type detection logic |
| 318 | assert hasattr(rag, 'is_ollama_embedder'), "RAG should detect embedder type" |
| 319 | assert isinstance(rag.is_ollama_embedder, bool), "is_ollama_embedder should be boolean" |
| 320 | except Exception as e: |
| 321 | logger.warning(f"RAG initialization failed: {e}") |
| 322 | |
| 323 | |
| 324 | class TestEnvironmentVariableHandling: |
nothing calls this directly
no outgoing calls
no test coverage detected