class_docstr: Test case for CF Area.
class_docstr_tok: ["Test","case","for","CF","Area","."]
docstr: Test area2cf for swath definitions.
docstr_tok: ["Test","area2cf","for","swath","definitions","."]
code: def test_area2cf_swath(self, input_data_arr):
      """Test area2cf for swath definitions."""
      swath = SwathDefinition(
          lons=[[1, 1], [2, 2]], lats=[[1, 2], [1, 2]]
      )
      input_data_arr.attrs["area"] = swath
  
      res = area2cf(input_data_arr, include_lonlats=False)
      assert len(res) == 1
      assert "longitude" in res[0].coords
      assert "latitude" in res[0].coords
      assert "grid_mapping" not in res[0].attrs
  
file_path: satpy/satpy/tests/cf_tests/test_area.py
imports: import dask.array
  import numpy
  import pytest
  import xarray
  from pyresample import AreaDefinition, SwathDefinition
  from satpy.cf.area import _add_grid_mapping, area2cf
label_desc: Use image node_id 2 for calling the TestCFArea obj's underlying member method code with example usage: obj.test_area2cf_swath(input_data_arr) without return types