class_docstr: Test resampling a Scene to another Scene object.
docstr: Test requesting a composite after resampling when the sensor composites weren't loaded before.
docstr_tok: ["Test","requesting","a","composite","after","resampling","when","the","sensor","composites","were","n't","loaded","before","."]
code: def test_comp_loading_after_resampling_new_sensor(self):
      """Test requesting a composite after resampling when the sensor composites weren't loaded before."""
      # this is our base Scene with sensor "fake_sensor2"
      scene1 = Scene(filenames=["fake2_3ds_1.txt"], reader="fake2_3ds")
      scene1.load(["ds2"])
      new_scn = scene1.resample(resampler="native")
  
      # Can't load from readers after resampling
      with pytest.raises(KeyError):
          new_scn.load(["ds3"])
  
      # Can't load the composite from fake_sensor composites yet
      # 'ds1' is missing
      with pytest.raises(KeyError):
          new_scn.load(["comp2"])
  
      # artificial DataArray "created by the user"
      # mimics a user adding their own data with the same sensor
      user_da = scene1["ds2"].copy()
      user_da.attrs["name"] = "ds1"
      user_da.attrs["sensor"] = {"fake_sensor2"}
      # Add 'ds1' that doesn't provide the 'fake_sensor' sensor
      new_scn["ds1"] = user_da
      with pytest.raises(KeyError):
          new_scn.load(["comp2"])
      assert "comp2" not in new_scn
  
      # artificial DataArray "created by the user"
      # mimics a user adding their own data with its own sensor to the Scene
      user_da = scene1["ds2"].copy()
      user_da.attrs["name"] = "ds1"
      user_da.attrs["sensor"] = {"fake_sensor"}
      # Now 'fake_sensor' composites have been loaded
      new_scn["ds1"] = user_da
      new_scn.load(["comp2"])
      assert "comp2" in new_scn
  
imports: from unittest import mock
  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 make_cid, make_dataid
label_desc: Use image node_id 11 for calling the TestSceneResampling obj's underlying member method code with example usage: obj.test_comp_loading_after_resampling_new_sensor() without return types