code: def test_load_invalid_checkpoint(self):
      with self.assertRaises(ValueError):
          self.test_experiment.load_checkpoint(
              self.NO_CHECKPOINT_EPOCHS[0]
          )
  
      with self.assertRaises(FileNotFoundError):
          self.test_experiment.load_checkpoint(
              self.no_checkpoint_paths[0]
          )
  
      temp_dir_obj = TemporaryDirectory()
      test_checkpoints_path = temp_dir_obj.name
      expt = Experiment(
          test_checkpoints_path,
          nn.Linear(1, 1),
          optimizer="sgd",
          loss_function="mse",
      )
      with self.assertRaises(ValueError):
          expt.load_checkpoint("best")
  
      with self.assertRaises(ValueError):
          expt.load_checkpoint("last")
  
imports: import os
  from tempfile import TemporaryDirectory
  from unittest import TestCase
  import torch
  from torch import nn
  from poutyne import Experiment
  from tests.framework.experiment.utils import ConstantMetric, ConstantMetricCallback
  from tests.framework.tools import SomeDataGeneratorWithLen
label_desc: Use image node_id 7 for calling the BaseExperimentCheckpointLoadingTest obj's underlying member method code with example usage: obj.test_load_invalid_checkpoint() without return types