refactor: move the site image tools into sitegen

This commit is contained in:
Abdessamad Derraz committed 2026-11-21 14:59:03 +01:00
1 parent 0b91bc9e37
commit f158f1d485
14 files changed
+561 -477

No files matched your search

+2 -2
View File
@@ -721,7 +721,7 @@ class LogosAtTheirDisplaySize(unittest.TestCase):
if path.suffix == ".webp":
self.assertEqual(_webp_size(path.read_bytes()), (LOGO_PIXELS, LOGO_PIXELS))
self.assertEqual(sorted(p.name for p in LOGOS.glob("*.png")), [])
script = _read(REPO_ROOT / "scripts" / "fetch_site_images.py")
script = script_source("fetch_site_images.py")
self.assertIn(f"LOGO_SIZE = {LOGO_PIXELS}", script)
self.assertIn('square_image(\n data, LOGO_SIZE, "WEBP"', script)
@@ -1069,7 +1069,7 @@ class LogosAtTheirWeight(unittest.TestCase):
self.assertLessEqual(max(width, height), 80)
def test_the_fetcher_writes_them_so(self):
script = _read(REPO_ROOT / "scripts" / "fetch_site_images.py")
script = script_source("fetch_site_images.py")
self.assertIn('minify_svg(shrink_embedded(safe_svg(data, url)))', script)