class_docstr: Test the bilinear resampler.
class_docstr_tok: ["Test","the","bilinear","resampler","."]
docstr: Test that existing caches are moved to a subdirectory.
code: def test_move_existing_caches(self):
      """Test that existing caches are moved to a subdirectory."""
      try:
          the_dir = tempfile.mkdtemp()
          # Test that existing cache file is moved away
          zarr_file = os.path.join(the_dir, "test.zarr")
          with open(zarr_file, "w") as fid:
              fid.write("42")
          from satpy.resample import _move_existing_caches
  
          _move_existing_caches(the_dir, zarr_file)
          assert not os.path.exists(zarr_file)
          assert os.path.exists(
              os.path.join(the_dir, "moved_by_satpy", "test.zarr")
          )
          # Run again to see that the existing dir doesn't matter
          with open(zarr_file, "w") as fid:
              fid.write("42")
          _move_existing_caches(the_dir, zarr_file)
      finally:
          shutil.rmtree(the_dir)
  
imports: import os
  import shutil
  import tempfile
  import unittest
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
  from pyproj import CRS
  from satpy.resample import NativeResampler
label_desc: Use image node_id 2 for calling the TestBilinearResampler obj's underlying member method code with example usage: obj.test_move_existing_caches() without return types