test: adding new tests and updating existing ones
Code Coverage is now 92%
This commit is contained in:
@@ -24,8 +24,13 @@ class TestStealthyFetcher:
|
||||
"html_url": f"{url}/html",
|
||||
"delayed_url": f"{url}/delay/10", # 10 Seconds delay response
|
||||
"cookies_url": f"{url}/cookies/set/test/value",
|
||||
"cloudflare_url": "https://nopecha.com/demo/cloudflare", # Interactive turnstile page
|
||||
}
|
||||
|
||||
async def test_cloudflare_fetch(self, fetcher, urls):
|
||||
"""Test if Cloudflare bypass is working"""
|
||||
assert (await fetcher.async_fetch(urls["cloudflare_url"], solve_cloudflare=True)).status == 200
|
||||
|
||||
async def test_basic_fetch(self, fetcher, urls):
|
||||
"""Test doing a basic fetch request with multiple statuses"""
|
||||
assert (await fetcher.async_fetch(urls["status_200"])).status == 200
|
||||
@@ -63,7 +68,7 @@ class TestStealthyFetcher:
|
||||
{
|
||||
"network_idle": True,
|
||||
"wait": 10,
|
||||
"cookies": [],
|
||||
"cookies": [{"name": "test", "value": "123", "domain": "example.com", "path": "/"}],
|
||||
"google_search": True,
|
||||
"extra_headers": {"ayo": ""},
|
||||
"os_randomize": True,
|
||||
|
||||
@@ -65,7 +65,7 @@ class TestDynamicFetcherAsync:
|
||||
"locale": "en-US",
|
||||
"extra_headers": {"ayo": ""},
|
||||
"useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0",
|
||||
"cookies": [],
|
||||
"cookies": [{"name": "test", "value": "123", "domain": "example.com", "path": "/"}],
|
||||
"network_idle": True,
|
||||
"custom_config": {"keep_comments": False, "keep_cdata": False},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user