code: def test_get_field_dict(self, mock_open):
      state = {
          torchbearer.EPOCH: 0,
          torchbearer.BATCH: 1,
          torchbearer.METRICS: {
              "test_metric_1": 0.1,
              "test_metric_2": 5,
          },
      }
      correct_fields_dict = {
          "epoch": 0,
          "batch": 1,
          "test_metric_1": 0.1,
          "test_metric_2": 5,
      }
  
      logger = CSVLogger("test_file.log", batch_granularity=True)
  
      logger_fields_dict = logger._get_field_dict(state)
  
      self.assertDictEqual(logger_fields_dict, correct_fields_dict)
  
file_path: torchbearer/tests/callbacks/test_csv_logger.py
imports: from unittest import TestCase
  from mock import patch, mock_open
  import torchbearer
  from torchbearer.callbacks import CSVLogger
label_desc: Use image node_id 5 for calling the TestCSVLogger obj's underlying member method code with example usage: obj.test_get_field_dict(mock_open) without return types