code: def test_snapshotter(self, mode, files):
      snapshotter = Snapshotter(self.temp_dir.name, mode, 1)
  
      assert snapshotter.snapshot_dir == self.temp_dir.name
      assert snapshotter.snapshot_mode == mode
      assert snapshotter.snapshot_gap == 1
  
      snapshot_data = [{"testparam": 1}, {"testparam": 4}]
      snapshotter.save_itr_params(1, snapshot_data[0])
      snapshotter.save_itr_params(2, snapshot_data[1])
  
      for f, num in files.items():
          filename = osp.join(self.temp_dir.name, f)
          assert osp.exists(filename)
          with open(filename, "rb") as pkl_file:
              data = pickle.load(pkl_file)
              assert data == snapshot_data[num]
  
file_path: garage/tests/garage/experiment/test_snapshotter.py
imports: from os import path
  import pickle
  import tempfile
  import pytest
  from garage.experiment import Snapshotter
label_desc: Use image node_id 3 for calling the TestSnapshotter obj's underlying member method code with example usage: obj.test_snapshotter(mode, files) without return types