class_docstr: Class implements base tests for binary headers
  
  It serves as a base class for other binary header tests
class_docstr_tok: ["Class","implements","base","tests","for","binary","headers","It","serves","as","a","base","class","for","other","binary","header","tests"]
code: def test_binblock_is_file(self):
      # Checks that the binary string representation is the whole of the
      # header file.  This is true for Analyze types, but not true Nifti
      # single file headers, for example, because they will have extension
      # strings following.  More generally, there may be other perhaps
      # optional data after the binary block, in which case you will need to
      # override this test
      hdr = self.header_class()
      str_io = BytesIO()
      hdr.write_to(str_io)
      assert str_io.getvalue() == hdr.binaryblock
  
imports: import logging
  from io import BytesIO, StringIO
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from ..None import imageglobals
  from ..batteryrunners import Report
  from ..casting import sctypes
  from ..spatialimages import HeaderDataError
  from ..volumeutils import Recoder, native_code, swapped_code
  from ..wrapstruct import LabeledWrapStruct, WrapStruct, WrapStructError
label_desc: Use image node_id 9 for calling the _TestWrapStructBase obj's underlying member method code with example usage: obj.test_binblock_is_file() without return types