Skip to content

test: add unit tests for postprocess blending functions#422

Merged
dreamlessx merged 1 commit intodreamlessx:mainfrom
wangwangbobo:add-postprocess-tests-414
Mar 21, 2026
Merged

test: add unit tests for postprocess blending functions#422
dreamlessx merged 1 commit intodreamlessx:mainfrom
wangwangbobo:add-postprocess-tests-414

Conversation

@wangwangbobo
Copy link
Contributor

Closes #414

Added 4 new tests for issue #414:

  1. test_laplacian_blend_identity - blending image with itself returns same image
  2. test_laplacian_blend_shapes - output shape matches input for various resolutions (64x64 to 1024x768)
  3. test_feathered_mask_range - output pixel values stay in [0, 255] range
  4. test_histogram_match_preserves_structure - SSIM correlation > 0.85

All tests use synthetic numpy arrays — no GPU or model weights needed.

Closes dreamlessx#414

Added 4 new tests for issue dreamlessx#414:
1. test_laplacian_blend_identity - blending image with itself
2. test_laplacian_blend_shapes - various resolutions (64x64 to 1024x768)
3. test_feathered_mask_range - output stays in [0, 255]
4. test_histogram_match_preserves_structure - SSIM correlation > 0.85

All tests use synthetic numpy arrays, no GPU or model weights needed.
@dreamlessx
Copy link
Owner

Welcome @wangwangbobo! Great first contribution — these 4 tests directly address #414 and are well-structured:

  • Identity blend test — correct use of tolerance for pyramid numerical error
  • Shape tests — good coverage across resolutions (64×64 through 1024×768)
  • Feathered mask range — properly tests with gradient mask
  • Histogram preservation — correlation check is a smart lightweight alternative to full SSIM

CI needs to run — I'll approve the workflow. Once it passes, this is ready to merge.

@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dreamlessx dreamlessx merged commit 484882a into dreamlessx:main Mar 21, 2026
7 checks passed
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.

Add unit tests for postprocess.py blending functions

2 participants