Spaces:
Runtime error
Runtime error
Download src/tests/unit/test_processor.py from VashuTheGreat2/Multi-Rag: direct link, hf CLI and curl.
- Browser
- Download file 658 Bytes
-
https://huggingface.co/spaces/VashuTheGreat2/Multi-Rag/resolve/main/src/tests/unit/test_processor.py
- Command line
-
hf download hf://spaces/VashuTheGreat2/Multi-Rag/src/tests/unit/test_processor.py
-
curl -L -o test_processor.py https://huggingface.co/spaces/VashuTheGreat2/Multi-Rag/resolve/main/src/tests/unit/test_processor.py
658 Bytes
| from unittest.mock import AsyncMock, MagicMock, patch | |
| import pytest | |
| from src.ingestion.processor import process_file | |
| TEXT_FILE_PATH = "data/tests/text.txt" | |
| async def test_process_file(mock_get_client, tmp_path): | |
| """Test for ingesting file""" | |
| mock_client = MagicMock() | |
| mock_client.upsert = AsyncMock(return_value=True) | |
| mock_get_client.return_value = mock_client | |
| text_file = tmp_path / "sample.txt" | |
| text_file.write_text("Processor test fixture", encoding="utf-8") | |
| value = await process_file(file_path=str(text_file)) | |
| assert value == True | |