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_general_init(self):
      hdr = self.header_class()
      # binaryblock has length given by header data dtype
      binblock = hdr.binaryblock
      assert len(binblock) == hdr.structarr.dtype.itemsize
      # Endianness will be native by default for empty header
      assert hdr.endianness == native_code
      # But you can change this if you want
      hdr = self.header_class(endianness="swapped")
      assert hdr.endianness == swapped_code
      # You can also pass in a check flag, without data this has no
      # effect
      hdr = self.header_class(check=False)
  
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 2 for calling the _TestWrapStructBase obj's underlying member method code with example usage: obj.test_general_init() without return types