class_docstr: Test the fraction bucket resampler.
class_docstr_tok: ["Test","the","fraction","bucket","resampler","."]
docstr: Test fraction bucket resamplers resample method.
code: def test_resample(self, pyresample_bucket):
      """Test fraction bucket resamplers resample method."""
      self.bucket.resampler = mock.MagicMock()
      self.bucket.precompute = mock.MagicMock()
      self.bucket.compute = mock.MagicMock()
  
      # Fractions return a dict
      data = xr.DataArray(da.ones((1, 5, 5)), dims=("bands", "y", "x"))
      arr = da.ones((5, 5))
      self.bucket.compute.return_value = {0: arr, 1: arr, 2: arr}
      res = self.bucket.resample(data)
      assert "categories" in res.coords
      assert "categories" in res.dims
      assert np.all(res.coords["categories"] == np.array([0, 1, 2]))
  
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 3 for calling the TestBucketFraction obj's underlying member method code with example usage: obj.test_resample(pyresample_bucket) without return types