From 15f135d78ca831a7547e473b83d8397f63311ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Thu, 7 Nov 2024 17:58:39 +0100 Subject: [PATCH] test: Test on the real test websites, not mocked --- tests/scrape.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/scrape.py b/tests/scrape.py index d54a451..e288ad4 100644 --- a/tests/scrape.py +++ b/tests/scrape.py @@ -5,7 +5,7 @@ from os import environ as env, walk from os.path import join from uuid import uuid4 -from zipfile import ZIP_DEFLATED, ZipFile +from zipfile import ZipFile import pytest from aiofiles import open @@ -89,25 +89,25 @@ async def test_scrape_page_website( # Check content is not empty assert page.content, "Content should not be empty" - # debug: Write Markdown content to file, then rebuild the compressed file - async with open( - encoding="utf-8", - file=join(website_path, f"{website}.md"), - mode="w", - ) as f: - await f.write(page.content) - with ZipFile( - compression=ZIP_DEFLATED, - compresslevel=9, - file=join(dir_tests("websites"), f"{website}.zip"), - mode="w", - ) as z: - for walk_root, walk_dirs, walk_files in walk(website_path): - for walk_file in walk_files: - z.write( - arcname=walk_file, - filename=join(walk_root, walk_file), - ) + # debug: Write Markdown content to file, then rebuild the compressed file, this should be used to generate the test content when upgrading Playwright or pypandoc + # async with open( + # encoding="utf-8", + # file=join(website_path, f"{website}.md"), + # mode="w", + # ) as f: + # await f.write(page.content) + # with ZipFile( + # compression=ZIP_DEFLATED, + # compresslevel=9, + # file=join(dir_tests("websites"), f"{website}.zip"), + # mode="w", + # ) as z: + # for walk_root, walk_dirs, walk_files in walk(website_path): + # for walk_file in walk_files: + # z.write( + # arcname=walk_file, + # filename=join(walk_root, walk_file), + # ) # Check Markdown content async with open(