tests.test_images moduleΒΆ

Tests for image optimization utilities.

tests.test_images.test_optimization_result_saved_bytes()[source]ΒΆ

Saved bytes is the difference between before and after.

Return type:

None

tests.test_images.test_optimization_result_saved_pct()[source]ΒΆ

Saved percentage is computed from before/after.

Return type:

None

tests.test_images.test_optimization_result_zero_before()[source]ΒΆ

Zero-byte file produces 0% savings.

Return type:

None

tests.test_images.test_generate_markdown_summary_empty()[source]ΒΆ

Empty results produce a simple message.

Return type:

None

tests.test_images.test_generate_markdown_summary_single_result()[source]ΒΆ

Summary table with a single result.

Column padding is the renderer’s business, so the header is matched on its cells rather than on an exact line.

Return type:

None

tests.test_images.test_generate_markdown_summary_multiple_results()[source]ΒΆ

Summary table with multiple results shows totals.

Return type:

None

tests.test_images.test_optimize_image_missing_tool(tmp_path)[source]ΒΆ

Returns None when the required tool is not on $PATH.

Return type:

None

tests.test_images.test_optimize_image_zero_byte_file(tmp_path)[source]ΒΆ

Returns None for empty files.

Return type:

None

tests.test_images.test_optimize_image_unsupported_extension(tmp_path)[source]ΒΆ

Returns None for unsupported file extensions.

Return type:

None

tests.test_images.test_optimize_image_below_threshold(tmp_path)[source]ΒΆ

Restores original when savings are below threshold.

Return type:

None

tests.test_images.test_optimize_image_below_bytes_threshold(tmp_path)[source]ΒΆ

Restores original when absolute byte savings are below threshold.

Return type:

None

tests.test_images.test_optimize_image_above_threshold(tmp_path)[source]ΒΆ

Returns result when savings exceed threshold.

Return type:

None

tests.test_images.test_optimize_image_restores_on_failure(tmp_path)[source]ΒΆ

Original file is restored when the optimizer tool fails.

Return type:

None