code: def test_console_printer(self, mock_print):
      state = {
          torchbearer.BATCH: 5,
          torchbearer.EPOCH: 1,
          torchbearer.MAX_EPOCHS: 10,
          torchbearer.TRAIN_STEPS: 100,
          torchbearer.VALIDATION_STEPS: 101,
          torchbearer.METRICS: {"test": 0.99456},
      }
      printer = ConsolePrinter(validation_label_letter="e")
      state[torchbearer.STEPS] = state[torchbearer.TRAIN_STEPS]
  
      printer.on_step_training(state)
      mock_print.assert_called_once_with(
          "\r1/10(t): 5/100 test=0.9946", end=""
      )
      mock_print.reset_mock()
  
      printer.on_end_training(state)
      mock_print.assert_called_once_with("\r1/10(t): test=0.9946")
      mock_print.reset_mock()
  
      state[torchbearer.STEPS] = state[torchbearer.VALIDATION_STEPS]
      printer.on_step_validation(state)
      mock_print.assert_called_once_with(
          "\r1/10(e): 5/101 test=0.9946", end=""
      )
      mock_print.reset_mock()
  
      printer.on_end_validation(state)
      mock_print.assert_called_once_with("\r1/10(e): test=0.9946")
      mock_print.reset_mock()
  
file_path: torchbearer/tests/callbacks/test_printer.py
imports: from unittest import TestCase
  from mock import patch, MagicMock
  import torchbearer
  from torchbearer.callbacks import Tqdm, ConsolePrinter
label_desc: Use image node_id 1 for calling the TestConsolePrinter obj's underlying member method code with example usage: obj.test_console_printer(mock_print) without return types