class_docstr: Unit tests for calibration.
class_docstr_tok: ["Unit","tests","for","calibration","."]
docstr: Test the calibration.
docstr_tok: ["Test","the","calibration","."]
code: def test_calibrate(
      self,
      file_handler,
      counts,
      channel,
      calibration,
      calib_mode,
      use_ext_coefs,
  ):
      """Test the calibration."""
      external_coefs = self.external_coefs if use_ext_coefs else {}
      expected = self._get_expected(
          channel=channel,
          calibration=calibration,
          calib_mode=calib_mode,
          use_ext_coefs=use_ext_coefs,
      )
  
      fh = file_handler
      fh.mda["spectral_channel_id"] = self.spectral_channel_ids[channel]
      fh.channel_name = channel
      fh.calib_mode = calib_mode
      fh.ext_calib_coefs = external_coefs
      res = fh.calibrate(counts, calibration)
      xr.testing.assert_allclose(res, expected)
  
imports: import unittest
  from datetime import datetime
  from unittest import mock
  import numpy
  import pytest
  import xarray
  from numpy import testing
  from pyproj import CRS
  import satpy.tests.reader_tests.test_seviri_l1b_hrit_setup
  from satpy.readers.seviri_l1b_hrit import HRITMSGEpilogueFileHandler, HRITMSGFileHandler, HRITMSGPrologueFileHandler
  from satpy.tests.reader_tests.test_seviri_base import ORBIT_POLYNOMIALS_INVALID
  from satpy.tests.reader_tests.test_seviri_l1b_calibration import TestFileHandlerCalibrationBase
  from satpy.tests.utils import assert_attrs_equal, make_dataid
label_desc: Use image node_id 2 for calling the TestHRITMSGCalibration obj's underlying member method code with example usage: obj.test_calibrate(file_handler, counts, channel, calibration, calib_mode, use_ext_coefs) without return types