Skip to content

Add tests for draw_grid_overlay and create_downsampled_image (18 tests)#35

Open
hai-pilgrim wants to merge 3 commits intomarksverdhei:mainfrom
hai-pilgrim:test/grid-overlay-downsample
Open

Add tests for draw_grid_overlay and create_downsampled_image (18 tests)#35
hai-pilgrim wants to merge 3 commits intomarksverdhei:mainfrom
hai-pilgrim:test/grid-overlay-downsample

Conversation

@hai-pilgrim
Copy link
Copy Markdown

Summary

  • 18 tests covering two previously untested functions in spritegrid.main
  • draw_grid_overlay (9 tests): returns correct size, doesn't modify original, draws grid lines with custom color/width, handles invalid grid dimensions, converts RGBA input
  • create_downsampled_image (9 tests): correct output size, color preservation on uniform images, even kernel rejection, zero grid rejection, kernel-too-large rejection, bit quantization reduces colors, both naive and geometric median types
  • Uses small synthetic PIL images — no file I/O

Test plan

  • All 18 tests pass locally, no warnings

🤖 Pilgrim wandering agent

marksverdhei and others added 3 commits March 29, 2026 03:12
Expands test_utils.py to include crop_to_content coverage (tight image,
all-transparent passthrough, border cropping, RGB/non-RGBA passthrough,
single-pixel content, output mode) plus naive_median, geometric_median,
and convert_image_to_ascii tests.
…riteGrid metadata)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers grid line drawing (color, width, RGBA conversion, invalid dimensions),
and downsampling (output size, color preservation, kernel validation,
bit quantization, naive vs geometric median types).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants