class_docstr: Test update of dataset encodings.
docstr: Test data with a time dimension.
docstr_tok: ["Test","data","with","a","time","dimension","."]
code: def test_with_time(self, fake_ds):
      """Test data with a time dimension."""
      from satpy.cf.encoding import update_encoding
  
      # With time dimension
      ds = fake_ds.chunk(8).expand_dims(
          {"time": [datetime.datetime(2009, 7, 1, 12, 15)]}
      )
      kwargs = {
          "encoding": {"bar": {"chunksizes": (1, 1, 1)}},
          "other": "kwargs",
      }
      enc, other_kwargs = update_encoding(ds, kwargs)
      expected_dict = {
          "y": {"_FillValue": None},
          "x": {"_FillValue": None},
          "lon": {"chunksizes": (2, 2)},
          "foo": {"chunksizes": (1, 2, 2)},
          "bar": {"chunksizes": (1, 1, 1)},
          "time": {
              "_FillValue": None,
              "calendar": "proleptic_gregorian",
              "units": "days since 2009-07-01 12:15:00",
          },
          "time_bnds": {
              "_FillValue": None,
              "calendar": "proleptic_gregorian",
              "units": "days since 2009-07-01 12:15:00",
          },
      }
      assert enc == expected_dict
      # User-defined encoding may not be altered
      assert kwargs["encoding"] == {"bar": {"chunksizes": (1, 1, 1)}}
  
file_path: satpy/satpy/tests/cf_tests/test_encoding.py
imports: import datetime
  import pytest
  import xarray
label_desc: Use image node_id 5 for calling the TestUpdateEncoding obj's underlying member method code with example usage: obj.test_with_time(fake_ds) without return types