Test that lazy_load yields Document objects with the correct dummy content and metadata.
(loader_with_dummy)
| 70 | |
| 71 | |
| 72 | def test_lazy_load(loader_with_dummy): |
| 73 | """Test that lazy_load yields Document objects with the correct dummy content and metadata.""" |
| 74 | docs = list(loader_with_dummy.lazy_load()) |
| 75 | assert len(docs) == 2 |
| 76 | for doc, url in zip(docs, loader_with_dummy.urls): |
| 77 | assert isinstance(doc, Document) |
| 78 | assert f"dummy content for {url}" in doc.page_content |
| 79 | assert doc.metadata["source"] == url |
| 80 | |
| 81 | |
| 82 | @pytest.mark.asyncio |