def METHOD_NAME(self, grib_api, min_data, max_data):
    # Check the use of a mask has been turned on via:
    #   eccodes.codes_set(grib_message, 'bitmapPresent', 1)
    #   eccodes.codes_set_double(grib_message, 'missingValue', ...)
    # and that a suitable fill value has been chosen.
    grib_api.codes_set.assert_called_once_with(GRIB_MESSAGE,
                                               'bitmapPresent', 1)
    args, = grib_api.codes_set_double.call_args_list
    (message, key, fill_value), kwargs = args
    self.assertIs(message, GRIB_MESSAGE)
    self.assertEqual(key, 'missingValue')
    self.assertTrue(fill_value < min_data or fill_value > max_data,
                    'Fill value {} is not outside data range '
                    '{} to {}.'.format(fill_value, min_data, max_data))
    return fill_value