def METHOD_NAME(self):
    num_lons = 8
    num_lats = 6
    num_times = 5
    lon_min = -20.
    lat_min = 12.
    res = 0.25
    res05 = res / 2
    lon = np.linspace(lon_min + res05, lon_min + num_lons * res - res05, num_lons)
    lat = np.linspace(lat_min + res05, lat_min + num_lats * res - res05, num_lats)
    lon_bnds = np.array([[v - res05, v + res05] for v in lon])
    lat_bnds = np.array([[v - res05, v + res05] for v in lat])
    time = [pd.to_datetime(f'2018-06-0{i}T12:00:00') for i in range(1, num_times + 1)]
    time_bnds = [(pd.to_datetime(f'2018-06-0{i}T00:00:00'),
                  pd.to_datetime(f'2018-06-0{i}T23:00:59')) for i in range(1, num_times + 1)]
    coords = dict(time=(['time'], time),
                  lat=(['lat'], lat),
                  lon=(['lon'], lon))
    coords_with_bnds = dict(time_bnds=(['time', 'bnds'], time_bnds),
                            lat_bnds=(['lat', 'bnds'], lat_bnds),
                            lon_bnds=(['lon', 'bnds'], lon_bnds),
                            **coords)
    output_metadata = dict(history='pipo', license='MIT', Conventions='CF-1.7')
    ds1 = xr.Dataset(coords=coords)
    ds2 = update_dataset_attrs(ds1, global_attrs=output_metadata)
    self.assertIsNot(ds2, ds1)
    self.assertEqual('CF-1.7', ds2.attrs.get('Conventions'))
    self.assertEqual('MIT', ds2.attrs.get('license'))
    self.assertEqual('pipo', ds2.attrs.get('history'))
    self.assertEqual(-20.0, ds2.attrs.get('geospatial_lon_min'))
    self.assertEqual(-18.0, ds2.attrs.get('geospatial_lon_max'))
    self.assertEqual(0.25, ds2.attrs.get('geospatial_lon_resolution'))
    self.assertEqual('degrees_east', ds2.attrs.get('geospatial_lon_units'))
    self.assertEqual(12.0, ds2.attrs.get('geospatial_lat_min'))
    self.assertEqual(13.5, ds2.attrs.get('geospatial_lat_max'))
    self.assertEqual(0.25, ds2.attrs.get('geospatial_lat_resolution'))
    self.assertEqual('degrees_north', ds2.attrs.get('geospatial_lat_units'))
    self.assertEqual('2018-06-01T00:00:00.000000000', ds2.attrs.get('time_coverage_start'))
    self.assertEqual('2018-06-06T00:00:00.000000000', ds2.attrs.get('time_coverage_end'))
    self.assertIn('date_modified', ds2.attrs)
    ds1 = xr.Dataset(coords=coords_with_bnds)
    ds2 = update_dataset_attrs(ds1, global_attrs=output_metadata)
    self.assertIsNot(ds2, ds1)
    self.assertEqual('CF-1.7', ds2.attrs.get('Conventions'))
    self.assertEqual('MIT', ds2.attrs.get('license'))
    self.assertEqual('pipo', ds2.attrs.get('history'))
    self.assertEqual(-20.0, ds2.attrs.get('geospatial_lon_min'))
    self.assertEqual(-18.0, ds2.attrs.get('geospatial_lon_max'))
    self.assertEqual(0.25, ds2.attrs.get('geospatial_lon_resolution'))
    self.assertEqual('degrees_east', ds2.attrs.get('geospatial_lon_units'))
    self.assertEqual(12.0, ds2.attrs.get('geospatial_lat_min'))
    self.assertEqual(13.5, ds2.attrs.get('geospatial_lat_max'))
    self.assertEqual(0.25, ds2.attrs.get('geospatial_lat_resolution'))
    self.assertEqual('degrees_north', ds2.attrs.get('geospatial_lat_units'))
    self.assertEqual('2018-06-01T00:00:00.000000000', ds2.attrs.get('time_coverage_start'))
    self.assertEqual('2018-06-05T23:00:59.000000000', ds2.attrs.get('time_coverage_end'))
    self.assertIn('date_modified', ds2.attrs)