class_docstr: Test netCDF compression encodings.
code: def _assert_encoding_as_expected(self, filename, expected):
      with xr.open_dataset(filename, mask_and_scale=False) as f:
          np.testing.assert_array_equal(
              f["test-array"][:], expected["data"]
          )
          assert (
              f["test-array"].attrs["scale_factor"]
              == expected["scale_factor"]
          )
          assert (
              f["test-array"].attrs["_FillValue"]
              == expected["fill_value"]
          )
          assert f["test-array"].dtype == expected["dtype"]
          assert (
              f["test-array"].encoding["complevel"]
              == expected["complevel"]
          )
  
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 8 for calling the TestNetcdfEncodingKwargs obj's underlying member method code with example usage: obj._assert_encoding_as_expected(filename, expected) without return types