tests.test_images moduleΒΆ
Tests for image optimization utilities.
- tests.test_images.test_image_optimizers_resolve_through_registry_or_path()[source]ΒΆ
oxipngcomes from the registry;jpegoptimstill needs$PATH.oxipng ships prebuilt binaries and is pinned and checksummed, while jpegoptim publishes source only and stays a distro package.
- Return type:
- tests.test_images.test_format_images_reports_an_install_failure(tmp_path)[source]ΒΆ
An oxipng that cannot be installed ends the command with a message.
- Return type:
- tests.test_images.test_format_images_writes_its_summary(tmp_path)[source]ΒΆ
Each optimized image lands in the summary table
--outputreceives.- Return type:
- tests.test_images.test_optimization_result_saved_bytes()[source]ΒΆ
Saved bytes is the difference between before and after.
- Return type:
- tests.test_images.test_optimization_result_saved_pct()[source]ΒΆ
Saved percentage is computed from before/after.
- Return type:
- tests.test_images.test_optimization_result_zero_before()[source]ΒΆ
Zero-byte file produces 0% savings.
- Return type:
- tests.test_images.test_generate_markdown_summary_empty()[source]ΒΆ
Empty results produce a simple message.
- Return type:
- 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:
- tests.test_images.test_generate_markdown_summary_multiple_results()[source]ΒΆ
Summary table with multiple results shows totals.
- Return type:
- tests.test_images.test_optimize_image_missing_tool(tmp_path)[source]ΒΆ
Returns None when the required tool is not on $PATH.
- Return type:
- tests.test_images.test_optimize_image_zero_byte_file(tmp_path)[source]ΒΆ
Returns None for empty files.
- Return type:
- tests.test_images.test_optimize_image_unsupported_extension(tmp_path)[source]ΒΆ
Returns None for unsupported file extensions.
- Return type:
- tests.test_images.test_optimize_image_below_threshold(tmp_path)[source]ΒΆ
Restores original when savings are below threshold.
- Return type:
- tests.test_images.test_optimize_image_below_bytes_threshold(tmp_path)[source]ΒΆ
Restores original when absolute byte savings are below threshold.
- Return type: