code: def test_header_warning():
      """Test warning is raised for NOK quality flag."""
      header_good = create_test_header(
          dataset_id=make_dataid(name="VIS006", resolution=3000),
          earth_model=1,
          is_full_disk=True,
          is_rapid_scan=0,
          good_qual="OK",
      )
      header_bad = create_test_header(
          dataset_id=make_dataid(name="VIS006", resolution=3000),
          earth_model=1,
          is_full_disk=True,
          is_rapid_scan=0,
          good_qual="NOK",
      )
  
      with mock.patch(
          "satpy.readers.seviri_l1b_native.np.fromfile"
      ) as fromfile, mock.patch(
          "satpy.readers.seviri_l1b_native.recarray2dict"
      ) as recarray2dict, mock.patch(
          "satpy.readers.seviri_l1b_native.NativeMSGFileHandler._get_memmap"
      ) as _get_memmap, mock.patch(
          "satpy.readers.seviri_l1b_native.NativeMSGFileHandler._read_trailer"
      ), mock.patch(
          "builtins.open", mock.mock_open(read_data=ASCII_STARTSWITH)
      ):
          recarray2dict.side_effect = lambda x: x
          _get_memmap.return_value = np.arange(3)
  
          exp_warning = "The quality flag for this file indicates not OK. Use this data with caution!"
  
          fromfile.return_value = header_good
          with warnings.catch_warnings():
              warnings.simplefilter("error")
              NativeMSGFileHandler(
                  filename=None, filename_info={}, filetype_info=None
              )
  
          fromfile.return_value = header_bad
          with pytest.warns(UserWarning, match=exp_warning):
              NativeMSGFileHandler(
                  filename=None, filename_info={}, filetype_info=None
              )
  
          # check that without Main Header the code doesn't crash
          header_missing = header_good.copy()
          header_missing.pop("15_MAIN_PRODUCT_HEADER")
          fromfile.return_value = header_missing
          with warnings.catch_warnings():
              warnings.simplefilter("error")
              NativeMSGFileHandler("myfile", {}, None)
  
imports: from __future__ import annotations
  import os
  import unittest
  import warnings
  from datetime import datetime
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
  from satpy.readers.eum_base import recarray2dict, time_cds_short
  from satpy.readers.seviri_l1b_native import ASCII_STARTSWITH, ImageBoundaries, NativeMSGFileHandler, Padder, get_available_channels, has_archive_header
  from satpy.tests.reader_tests.test_seviri_base import ORBIT_POLYNOMIALS, ORBIT_POLYNOMIALS_INVALID
  from satpy.tests.reader_tests.test_seviri_l1b_calibration import TestFileHandlerCalibrationBase
  from satpy.tests.utils import assert_attrs_equal, make_dataid
label_desc: Use image node_id 9 for calling a global function with example usage: test_header_warning() without return types