MCPcopy Create free account
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / test_invalid_proxy_raises_error

Function test_invalid_proxy_raises_error

tests/test_chromium.py:1922–1933  ·  view source on GitHub ↗

Test that providing an invalid proxy causes a ValueError during initialization (via parse_or_search_proxy).

(monkeypatch)

Source from the content-addressed store, hash-verified

1920
1921@pytest.mark.asyncio
1922async 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

Callers

nothing calls this directly

Calls 1

ChromiumLoaderClass · 0.90

Tested by

no test coverage detected