~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
Fix/pdf storage auto mode (#3390)
LearningCircuitb40905307730
diff --git a/tests/research_library/services/test_pdf_storage_manager.py b/tests/research_library/services/test_pdf_storage_manager.pyindex 9158a1af27..c749027325 100644--- a/tests/research_library/services/test_pdf_storage_manager.py+++ b/tests/research_library/services/test_pdf_storage_manager.py@@ -205,6 +205,68 @@ class TestPDFStorageManagerHasPdf:pass+class TestPDFStorageManagerPdfExists:+ """Tests for pdf_exists classmethod."""++ def test_returns_false_for_non_pdf(self, tmp_path):+ """Should return False for non-PDF documents without requiring a storage mode."""+ mock_doc = MagicMock()+ mock_doc.file_type = "txt"+ mock_session = MagicMock()++ result = PDFStorageManager.pdf_exists(tmp_path, mock_doc, mock_session)++ assert result is False++ def test_returns_true_when_blob_exists(self, tmp_path):+ """Should find PDF in database via classmethod."""+ mock_doc = MagicMock()+ mock_doc.id = "doc-123"+ mock_doc.file_type = "pdf"+ mock_doc.file_path = None+ mock_session = MagicMock()++ # Simulate DocumentBlob found in database+ mock_session.query.return_value.filter_by.return_value.first.return_value = MagicMock()++ mock_blob_class = MagicMock()+ with patch(+ "local_deep_research.database.models.library.DocumentBlob",+ mock_blob_class,+ ):+ result = PDFStorageManager.pdf_exists(+ tmp_path, mock_doc, mock_session+ )++ assert result is True++ def test_returns_true_when_file_exists(self, tmp_path):+ """Should find PDF on filesystem via classmethod."""+ pdf_dir = tmp_path / "pdfs"+ pdf_dir.mkdir()+ (pdf_dir / "test.pdf").write_bytes(b"%PDF-1.4 test")++ mock_doc = MagicMock()+ mock_doc.id = "doc-456"+ mock_doc.file_type = "pdf"+ mock_doc.file_path = "pdfs/test.pdf"+ mock_session = MagicMock()++ # No blob in database+ mock_session.query.return_value.filter_by.return_value.first.return_value = None++ mock_blob_class = MagicMock()+ with patch(+ "local_deep_research.database.models.library.DocumentBlob",+ mock_blob_class,+ ):+ result = PDFStorageManager.pdf_exists(+ tmp_path, mock_doc, mock_session+ )++ assert result is True++class TestPDFStorageManagerDeletePdf:"""Tests for delete_pdf method."""