🌐 AI搜索 & 代理 主页
Skip to content

Commit 05f6500

Browse files
committed
[URL Health] Code cleanup & maintenance
1 parent f62fb9f commit 05f6500

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/url-health-checking/test_async_url_health_check.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
sys.path.append(sys.path[0] + "/../../")
88

9+
async def check_status(session, url):
10+
async with session.get(url) as response:
11+
status_code = response.status
12+
print(url + " status = " + str(status_code) + " ")
13+
return status_code
14+
915
class TestAsyncHealthCheckOps:
1016
@pytest.mark.asyncio
1117
@pytest.mark.run(order=1)
@@ -18,12 +24,6 @@ async def test_async_url_access(self, driver) -> list:
1824

1925
meta_data_arr = helpers.scrap_playground_url(driver)
2026

21-
async def check_status(session, url):
22-
async with session.get(url) as response:
23-
status_code = response.status
24-
print(url + " status = " + str(status_code) + " ")
25-
return status_code
26-
2727
async with aiohttp.ClientSession() as session:
2828
tasks = [check_status(session, url) for url in meta_data_arr]
2929
status_codes = await asyncio.gather(*tasks)

0 commit comments

Comments
 (0)