Skip to content

No test covers generate_favicons.py's malformed-logo.svg error paths #245

Description

@yakew7

scripts/generate_favicons.py's _parse_mark() raises ValueError in three cases - a non-square-at-origin viewBox, logo.svg no longer being exactly three <rect> children, and the stem/top-bar rects not sharing a fill color - specifically so a future edit to logo.svg that outgrows this hand-rolled parser fails loudly instead of silently drawing the wrong icon.

tests/test_generate_images.py (added in #234) only exercises the happy path (test_generate_favicons runs the real logo.svg through main() and checks output files/dimensions). None of the three error paths have a test.

Add a few cases that write a temporary malformed SVG (wrong viewBox, four rects instead of three, mismatched stem/bar fill) to a tmp file, point script.LOGO_SVG at it, and assert _parse_mark raises with the expected message. Doesn't touch logo.svg itself or its real generated output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions