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_endian_guess(self):
      # Check guesses of endian
      eh = self.header_class()
      assert eh.endianness == native_code
      hdr_data = eh.structarr.copy()
      hdr_data = hdr_data.byteswap(swapped_code)
      eh_swapped = self.header_class(hdr_data.tobytes())
      assert eh_swapped.endianness == swapped_code
  
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 8 for calling the _TestWrapStructBase obj's underlying member method code with example usage: obj.test_endian_guess() without return types