repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | import hashlib |
| #2 | from unittest.mock import patch |
| #3 | |
| #4 | import pytest |
| #5 | |
| #6 | from embedchain.loaders.excel_file import ExcelFileLoader |
| #7 | |
| #8 | |
| #9 | @pytest.fixture |
| #10 | def excel_file_loader(): |
| #11 | return ExcelFileLoader() |
| #12 | |
| #13 | |
| #14 | def test_load_data(excel_file_loader): |
| #15 | mock_url = "mock_excel_file.xlsx" |
| #16 | expected_content = "Sample Excel Content" |
| #17 | |
| #18 | # Mock the load_data method of the excel_file_loader instance |
| #19 | with patch.object( |
| #20 | excel_file_loader, |
| #21 | "load_data", |
| #22 | return_value={ |
| #23 | "doc_id": hashlib.sha256((expected_content + mock_url).encode()).hexdigest(), |
| #24 | "data": [{"content": expected_content, "meta_data": {"url": mock_url}}], |
| #25 | }, |
| #26 | ): |
| #27 | result = excel_file_loader.load_data(mock_url) |
| #28 | |
| #29 | assert result["data"][0]["content"] == expected_content |
| #30 | assert result["data"][0]["meta_data"]["url"] == mock_url |
| #31 | |
| #32 | expected_doc_id = hashlib.sha256((expected_content + mock_url).encode()).hexdigest() |
| #33 | assert result["doc_id"] == expected_doc_id |
| #34 |