class_docstr: Tests for the AHI HSD file handler.
class_docstr_tok: ["Tests","for","the","AHI","HSD","file","handler","."]
docstr: Test erraneous blocklength.
docstr_tok: ["Test","erraneous","blocklength","."]
code: def test_blocklen_error(self, *mocks):
      """Test erraneous blocklength."""
      open_name = "%s.open" % __name__
      fpos = 50
      with _fake_hsd_handler() as fh, mock.patch(
          open_name, create=True
      ) as mock_open, mock_open(mock.MagicMock(), "r") as fp_:
          # Expected and actual blocklength match
          fp_.tell.return_value = 50
          with warnings.catch_warnings(record=True) as w:
              fh._check_fpos(fp_, fpos, 0, "header 1")
              assert len(w) == 0
  
          # Expected and actual blocklength do not match
          fp_.tell.return_value = 100
          with pytest.warns(
              UserWarning,
              match=r"Actual .* header size does not match expected",
          ):
              fh._check_fpos(fp_, fpos, 0, "header 1")
  
imports: from __future__ import annotations
  import contextlib
  import unittest
  import warnings
  from datetime import datetime
  from typing import Any, Dict
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  from satpy.readers.ahi_hsd import AHIHSDFileHandler
  from satpy.readers.utils import get_geostationary_mask
  from satpy.tests.utils import make_dataid
label_desc: Use image node_id 9 for calling the TestAHIHSDFileHandler obj's underlying member method code with example usage: obj.test_blocklen_error() without return types