class_docstr: Test cases for CF time dimension and coordinates.
class_docstr_tok: ["Test","cases","for","CF","time","dimension","and","coordinates","."]
docstr: Test addition of CF-compliant time attributes.
docstr_tok: ["Test","addition","of","CF-compliant","time","attributes","."]
code: def test_add_time_bounds_dimension(self):
      """Test addition of CF-compliant time attributes."""
      from satpy.cf.coords import add_time_bounds_dimension
  
      test_array = np.array([[1, 2], [3, 4], [5, 6], [7, 8]])
      times = np.array(
          [
              "2018-05-30T10:05:00",
              "2018-05-30T10:05:01",
              "2018-05-30T10:05:02",
              "2018-05-30T10:05:03",
          ],
          dtype=np.datetime64,
      )
      dataarray = xr.DataArray(
          test_array,
          dims=["y", "x"],
          coords={"time": ("y", times)},
          attrs=dict(start_time=times[0], end_time=times[-1]),
      )
      ds = dataarray.to_dataset(name="test-array")
      ds = add_time_bounds_dimension(ds)
  
      assert "bnds_1d" in ds.dims
      assert ds.dims["bnds_1d"] == 2
      assert "time_bnds" in list(ds.data_vars)
      assert "bounds" in ds["time"].attrs
      assert "standard_name" in ds["time"].attrs
  
file_path: satpy/satpy/tests/cf_tests/test_coords.py
imports: import logging
  import numpy
  import pytest
  import xarray
  from pyresample import AreaDefinition
label_desc: Use image node_id 1 for calling the TestCFtime obj's underlying member method code with example usage: obj.test_add_time_bounds_dimension() without return types