def _test_restrict_filtering(self, input_types, restrict_write, restrict_read,
                               expected_output_types):
    """Test restrict behavior on types written and read through tempfile.

    Args:
      input_types: A list of the types to start with.
      restrict_write: A list of the restrict_to to use while writing.
      restrict_read: A list of the restrict_to to use while reading.
      expected_output_types: A list of the types to expect returned.
    """
    symbol_table_dict = {t: symbol.SymbolTable() for t in input_types}
    io.write_symbol_table_dict(
        self.filename,
        symbol_table_dict,
        restrict_to=[r for r in restrict_write])
    io_symbol_table_dict = io.read_symbol_table_dict(
        self.filename, restrict_to=[r for r in restrict_read])
    io_output_types = ''.join(sorted(io_symbol_table_dict.keys()))
    self.assertEqual(io_output_types, expected_output_types)
Test restrict behavior on types written and read through tempfile.

    Args:
      input_types: A list of the types to start with.
      restrict_write: A list of the restrict_to to use while writing.
      restrict_read: A list of the restrict_to to use while reading.
      expected_output_types: A list of the types to expect returned.
    
language/nql/nql/io_test.py