class_docstr: Test case for CF writer.
docstr: Test setting a single time value.
docstr_tok: ["Test","setting","a","single","time","value","."]
code: def test_single_time_value(self):
      """Test setting a single time value."""
      scn = Scene()
      start_time = datetime(2018, 5, 30, 10, 0)
      end_time = datetime(2018, 5, 30, 10, 15)
      test_array = np.array([[1, 2], [3, 4]])
      scn["test-array"] = xr.DataArray(
          test_array,
          dims=["x", "y"],
          coords={"time": np.datetime64("2018-05-30T10:05:00", "ns")},
          attrs=dict(start_time=start_time, end_time=end_time),
      )
      with TempFile() as filename:
          scn.save_datasets(
              filename=filename,
              writer="cf",
              encoding={"time": {"units": "seconds since 2018-01-01"}},
          )
          with xr.open_dataset(filename, decode_cf=True) as f:
              np.testing.assert_array_equal(
                  f["time"], scn["test-array"]["time"]
              )
              bounds_exp = np.array(
                  [[start_time, end_time]], dtype="datetime64[m]"
              )
              np.testing.assert_array_equal(f["time_bnds"], bounds_exp)
  
imports: import os
  import tempfile
  import warnings
  from datetime import datetime
  import numpy
  import pytest
  import xarray
  from packaging.version import Version
  from satpy import Scene
  from satpy.tests.utils import make_dsq
  from satpy.writers.cf_writer import _get_backend_versions
label_desc: Use image node_id 10 for calling the TestCFWriter obj's underlying member method code with example usage: obj.test_single_time_value() without return types