Test that providing an invalid proxy causes a ValueError during initialization (via parse_or_search_proxy).
(monkeypatch)
| 1920 | |
| 1921 | @pytest.mark.asyncio |
| 1922 | async def test_invalid_proxy_raises_error(monkeypatch): |
| 1923 | """Test that providing an invalid proxy causes a ValueError during initialization (via parse_or_search_proxy).""" |
| 1924 | |
| 1925 | def fake_parse_or_search_proxy(proxy): |
| 1926 | raise ValueError("Invalid proxy") |
| 1927 | |
| 1928 | monkeypatch.setattr( |
| 1929 | "scrapegraphai.docloaders.chromium.parse_or_search_proxy", |
| 1930 | fake_parse_or_search_proxy, |
| 1931 | ) |
| 1932 | with pytest.raises(ValueError, match="Invalid proxy"): |
| 1933 | ChromiumLoader(["http://example.com"], backend="playwright", proxy="bad_proxy") |
| 1934 | |
| 1935 | |
| 1936 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected