Test that lazy_load yields Document objects correctly when urls is provided as a tuple.
(monkeypatch)
| 2168 | |
| 2169 | @pytest.mark.asyncio |
| 2170 | def test_lazy_load_with_tuple_urls(monkeypatch): |
| 2171 | """Test that lazy_load yields Document objects correctly when urls is provided as a tuple.""" |
| 2172 | urls = ("http://example.com", "http://test.com") |
| 2173 | loader = ChromiumLoader(urls, backend="playwright", requires_js_support=False) |
| 2174 | |
| 2175 | async def dummy_scraper(url, browser_name="chromium"): |
| 2176 | return f"<html>Tuple content for {url}</html>" |
| 2177 | |
| 2178 | monkeypatch.setattr(loader, "ascrape_playwright", dummy_scraper) |
| 2179 | docs = list(loader.lazy_load()) |
| 2180 | assert len(docs) == 2 |
| 2181 | for doc, url in zip(docs, urls): |
| 2182 | assert f"Tuple content for {url}" in doc.page_content |
| 2183 | assert doc.metadata["source"] == url |
nothing calls this directly
no test coverage detected