code: def test_write_header(self, mock_open):
      state = {
          torchbearer.EPOCH: 0,
          torchbearer.BATCH: 1,
          torchbearer.METRICS: {
              "test_metric_1": 0.1,
              "test_metric_2": 5,
          },
      }
  
      logger = CSVLogger("test_file.log")
      logger.on_start(state)
      logger.on_step_training(state)
      logger.on_end_epoch(state)
      logger.on_end(state)
  
      header = mock_open.mock_calls[1][1][0]
      self.assertTrue("epoch" in header)
      self.assertTrue("test_metric_1" in header)
      self.assertTrue("test_metric_2" in header)
  
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 1 for calling the TestCSVLogger obj's underlying member method code with example usage: obj.test_write_header(mock_open) without return types