class_docstr: Test the scene class.
class_docstr_tok: ["Test","the","scene","class","."]
docstr: Test iterating by area on a swath.
docstr_tok: ["Test","iterating","by","area","on","a","swath","."]
code: def test_iter_by_area_swath(self):
      """Test iterating by area on a swath."""
      from pyresample.geometry import SwathDefinition
  
      scene = Scene()
      sd = SwathDefinition(lons=np.arange(5), lats=np.arange(5))
      scene["1"] = xr.DataArray(np.arange(5), attrs={"area": sd})
      scene["2"] = xr.DataArray(np.arange(5), attrs={"area": sd})
      scene["3"] = xr.DataArray(np.arange(5))
      for area_obj, ds_list in scene.iter_by_area():
          ds_list_names = set(ds["name"] for ds in ds_list)
          if area_obj is sd:
              assert ds_list_names == {"1", "2"}
          else:
              assert area_obj is None
              assert ds_list_names == {"3"}
  
imports: import math
  import numpy
  import pytest
  import xarray
  from dask import array
  from satpy import Scene
  from satpy.dataset.dataid import default_id_keys_config
  from satpy.tests.utils import FAKE_FILEHANDLER_END, FAKE_FILEHANDLER_START, make_cid, make_dataid
label_desc: Use image node_id 4 for calling the TestDataAccessMethods obj's underlying member method code with example usage: obj.test_iter_by_area_swath() without return types