def test_infer_image_mimetype_from_file_path():
    """Test inferring image mimetype from file extensions."""
    # JPG/JPEG
    assert infer_image_mimetype_from_file_path("image.jpg") == "image/jpeg"
    assert infer_image_mimetype_from_file_path("image.jpeg") == "image/jpeg"

    # PNG
    assert infer_image_mimetype_from_file_path("image.png") == "image/png"

    # GIF
    assert infer_image_mimetype_from_file_path("image.gif") == "image/gif"

    # WEBP
    assert infer_image_mimetype_from_file_path("image.webp") == "image/webp"

    # Catch-all defaults
    assert infer_image_mimetype_from_file_path("image.asf32") == "image/jpeg"
    assert infer_image_mimetype_from_file_path("") == "image/jpeg"
Test inferring image mimetype from file extensions.
llama-index-core/tests/multi_modal_llms/test_generic_utils.py