def METHOD_NAME(
    probability_cube, expected_attr, expected_name, expected_inverted_probabilities
):
    """Test function inverts probabilities and updates cube metadata."""
    result = invert_probabilities(probability_cube)
    assert (
        result.coord(var_name="threshold").attributes["spp__relative_to_threshold"]
        == expected_attr
    )
    assert expected_name in result.name()
    assert_almost_equal(result.data, expected_inverted_probabilities)