class_docstr: Test the FciL2NCFileHandler when reading and extracting byte data.
class_docstr_tok: ["Test","the","FciL2NCFileHandler","when","reading","and","extracting","byte","data","."]
docstr: Set up the test by creating a test file and opening it with the reader.
docstr_tok: ["Set","up","the","test","by","creating","a","test","file","and","opening","it","with","the","reader","."]
code: def setUp(self):
      """Set up the test by creating a test file and opening it with the reader."""
      # Easiest way to test the reader is to create a test netCDF file on the fly
      self.test_byte_file = str(uuid.uuid4()) + ".nc"
      with Dataset(self.test_byte_file, "w") as nc_byte:
          # Create dimensions
          nc_byte.createDimension("number_of_columns", 1)
          nc_byte.createDimension("number_of_rows", 1)
  
          # add global attributes
          nc_byte.data_source = "test_data_source"
          nc_byte.platform = "test_platform"
  
          # Add datasets
          x = nc_byte.createVariable(
              "x", np.float32, dimensions=("number_of_columns",)
          )
          x.standard_name = "projection_x_coordinate"
          x[:] = np.arange(1)
  
          y = nc_byte.createVariable(
              "y", np.float32, dimensions=("number_of_rows",)
          )
          x.standard_name = "projection_y_coordinate"
          y[:] = np.arange(1)
  
          mtg_geos_projection = nc_byte.createVariable(
              "mtg_geos_projection", int, dimensions=()
          )
          mtg_geos_projection.longitude_of_projection_origin = 0.0
          mtg_geos_projection.semi_major_axis = 6378137.0
          mtg_geos_projection.inverse_flattening = 298.257223563
          mtg_geos_projection.perspective_point_height = 35786400.0
  
          test_dataset = nc_byte.createVariable(
              "cloud_mask_test_flag",
              np.float32,
              dimensions=(
                  "number_of_rows",
                  "number_of_columns",
              ),
          )
  
          # This number was chosen as we know the expected byte values
          test_dataset[:] = 4544767
  
      self.byte_reader = FciL2NCFileHandler(
          filename=self.test_byte_file,
          filename_info={},
          filetype_info={},
      )
  
imports: import os
  import unittest
  import uuid
  from contextlib import suppress
  from unittest import mock
  import numpy
  import pytest
  from netCDF4 import Dataset
  from pyresample import geometry
  from satpy.readers.fci_l2_nc import FciL2NCAMVFileHandler, FciL2NCFileHandler, FciL2NCSegmentFileHandler
  from satpy.tests.utils import make_dataid
label_desc: Use image node_id 1 for calling the TestFciL2NCReadingByteData obj's underlying member method code with example usage: obj.setUp() without return types