class_docstr: Test NetCDF4 File Handler Utility class.
class_docstr_tok: ["Test","NetCDF4","File","Handler","Utility","class","."]
docstr: Test that only listed variables/attributes area collected.
docstr_tok: ["Test","that","only","listed","variables\/attributes","area","collected","."]
code: def test_listed_variables(self):
      """Test that only listed variables/attributes area collected."""
      from satpy.readers.netcdf_utils import NetCDF4FileHandler
  
      filetype_info = {
          "required_netcdf_variables": [
              "test_group/attr/test_attr_str",
              "attr/test_attr_str",
          ]
      }
      file_handler = NetCDF4FileHandler("test.nc", {}, filetype_info)
      assert len(file_handler.file_content) == 2
      assert (
          "test_group/attr/test_attr_str" in file_handler.file_content
      )
      assert "attr/test_attr_str" in file_handler.file_content
  
imports: import os
  import unittest
  import numpy
  import pytest
label_desc: Use image node_id 4 for calling the TestNetCDF4FileHandler obj's underlying member method code with example usage: obj.test_listed_variables() without return types