From affd5d275973ed85ca38d721b3c424cddc2159a9 Mon Sep 17 00:00:00 2001 From: Waket Zheng Date: Thu, 27 Jun 2024 00:57:06 +0800 Subject: [PATCH] fix ci error --- tests/online_cdn/test_online_race.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/online_cdn/test_online_race.py b/tests/online_cdn/test_online_race.py index 66bd1d4..a446008 100644 --- a/tests/online_cdn/test_online_race.py +++ b/tests/online_cdn/test_online_race.py @@ -34,10 +34,16 @@ async def test_docs(client: AsyncClient): # nosec ) assert urls.css in url_list assert any(i in text for i in url_list) - assert any( - re.search(rf"{i.split('://')[-1].split('/')[0]}[\w/.-]+redoc", text2) - for i in url_list - ) + for url in url_list: + host = url.split("://")[-1].split("/")[0] + pattern = rf'src=".*{host}[\w/.-]+redoc.*"' + if m := re.search(pattern, text2): + print(f"{m.group() = }") + break + else: + src_urls = re.findall(r'src="[^"]*redoc[^"]*"', text2) + print(f"{src_urls = }") + print(f"{url_list = }") else: assert urls.js in text assert urls.css in text