code: def test_append(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", append=True)
      logger.on_start(state)
      logger.on_step_training(state)
      logger.on_end_epoch(state)
      logger.on_end(state)
  
      import sys
  
      if sys.version_info[0] < 3:
          self.assertTrue(mock_open.call_args[0][1] == "ab")
      else:
          self.assertTrue(mock_open.call_args[0][1] == "a")
  
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 4 for calling the TestCSVLogger obj's underlying member method code with example usage: obj.test_append(mock_open) without return types