From 2071e2beda763137416ac386d4bb953711ec995d Mon Sep 17 00:00:00 2001 From: cirakg Date: Sun, 18 Oct 2026 20:28:09 +0200 Subject: test(tools): add test-log judge, docs and policy checks with tests - ciq_test_report.py: decides pass/fail from Run No Evil output instead of monkeydo's unreliable exit code; writes JUnit XML. - check_docs.py: offline check of relative links and GitHub anchors. - lint_project.py: project rules (headers, no logging outside Diag, no secret-like literals, no network APIs or permissions). - check_budgets.py with budgets.json: perf and memory gates. - make_icon.py: reproducible launcher icon. - 31 pytest tests, including Hypothesis fuzzing of the log parser and integration checks against the real docs and sources; ruff and mypy (strict) clean. Co-Authored-By: Claude Opus 5.5 --- tools/tests/test_make_icon.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tools/tests/test_make_icon.py (limited to 'tools/tests/test_make_icon.py') diff --git a/tools/tests/test_make_icon.py b/tools/tests/test_make_icon.py new file mode 100644 index 0000000..66128c5 --- /dev/null +++ b/tools/tests/test_make_icon.py @@ -0,0 +1,25 @@ +"""Tests for tools/make_icon.py (launcher icon generator).""" + +from __future__ import annotations + +import make_icon +from PIL import Image + + +def rgba(img: Image.Image, xy: tuple[int, int]) -> tuple[int, ...]: + """One RGBA pixel as a tuple (Pillow's getpixel returns a wider union type).""" + value = img.getpixel(xy) + assert isinstance(value, tuple) + return value + + +def test_icon_size_transparency_and_colours() -> None: + img = make_icon.draw_icon(60) + assert img.size == (60, 60) + assert img.mode == "RGBA" + # Corners are outside the disc, so fully transparent. + assert rgba(img, (0, 0))[3] == 0 + # The disc edge is teal, the lock body in the middle is white. + r, g, b, a = rgba(img, (30, 4)) + assert a > 200 and g > r and b > r + assert rgba(img, (22, 40))[:3] == (255, 255, 255) -- cgit v1.2.3