code: def test_load_file_with_wrong_information(self):
      tck_file = open(DATA["simple_tck_fname"], "rb").read()
  
      # Simulate a TCK file where `datatype` has not the right endianness.
      new_tck_file = tck_file.replace(b"Float32LE", b"Float32BE")
  
      with pytest.raises(DataError):
          TckFile.load(BytesIO(new_tck_file))
  
      # Simulate a TCK file with unsupported `datatype`.
      new_tck_file = tck_file.replace(b"Float32LE", b"int32")
      with pytest.raises(HeaderError):
          TckFile.load(BytesIO(new_tck_file))
  
      # Simulate a TCK file with no `datatype` field.
      new_tck_file = tck_file.replace(b"datatype: Float32LE\n", b"")
      # Need to adjust data offset.
      new_tck_file = new_tck_file.replace(
          b"file: . 67\n", b"file: . 47\n"
      )
      with pytest.warns(HeaderWarning, match="Missing 'datatype'"):
          tck = TckFile.load(BytesIO(new_tck_file))
      assert_array_equal(tck.header["datatype"], "Float32LE")
  
      # Simulate a TCK file with no `file` field.
      new_tck_file = tck_file.replace(b"\nfile: . 67", b"")
      with pytest.warns(HeaderWarning, match="Missing 'file'") as w:
          tck = TckFile.load(BytesIO(new_tck_file))
      assert_array_equal(tck.header["file"], ". 56")
  
      # Simulate a TCK file with `file` field pointing to another file.
      new_tck_file = tck_file.replace(
          b"file: . 67\n", b"file: dummy.mat 75\n"
      )
      with pytest.raises(HeaderError):
          TckFile.load(BytesIO(new_tck_file))
  
      # Simulate a TCK file which is missing a streamline delimiter.
      eos = TckFile.FIBER_DELIMITER.tobytes()
      eof = TckFile.EOF_DELIMITER.tobytes()
      new_tck_file = (
          tck_file[: -(len(eos) + len(eof))] + tck_file[-len(eof) :]
      )
  
      # Force TCK loading to use buffering.
      buffer_size = 1.0 / 1024**2  # 1 bytes
      hdr = TckFile._read_header(BytesIO(new_tck_file))
      tck_reader = TckFile._read(
          BytesIO(new_tck_file), hdr, buffer_size
      )
      with pytest.raises(DataError):
          list(tck_reader)
  
      # Simulate a TCK file which is missing the end-of-file delimiter.
      new_tck_file = tck_file[: -len(eof)]
      with pytest.raises(DataError):
          TckFile.load(BytesIO(new_tck_file))
  
imports: import os
  import unittest
  from io import BytesIO
  from os.path import join
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from ...testing import data_path, error_warnings
  from ..None import tck
  from ..array_sequence import ArraySequence
  from ..tck import TckFile
  from ..tractogram import Tractogram
  from ..tractogram_file import DataError, HeaderError, HeaderWarning
  from .test_tractogram import assert_tractogram_equal
label_desc: Use image node_id 10 for calling the TestTCK obj's underlying member method code with example usage: obj.test_load_file_with_wrong_information() without return types