class_docstr: Test the scene class.
class_docstr_tok: ["Test","the","scene","class","."]
docstr: Test setting an item.
docstr_tok: ["Test","setting","an","item","."]
code: def test_setitem(self):
      """Test setting an item."""
      from satpy.tests.utils import make_dataid
  
      scene = Scene()
      scene["1"] = ds1 = xr.DataArray(np.arange(5))
      expected_id = make_cid(**ds1.attrs)
      assert set(scene._datasets.keys()) == {expected_id}
      assert set(scene._wishlist) == {expected_id}
  
      did = make_dataid(name="oranges")
      scene[did] = ds1
      assert "oranges" in scene
      nparray = np.arange(5 * 5).reshape(5, 5)
      with pytest.raises(
          ValueError,
          match="Key must be a DataID when value is not an xarray DataArray or dict",
      ):
          scene["apples"] = nparray
      assert "apples" not in scene
      did = make_dataid(name="apples")
      scene[did] = nparray
      assert "apples" in scene
  
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 6 for calling the TestDataAccessMethods obj's underlying member method code with example usage: obj.test_setitem() without return types