code: def test_saved_content(self, test_data, output_ext, resample):
      with tempfile.TemporaryDirectory() as tempdir:
          trans = SaveImaged(
              keys=["img", "pred"],
              output_dir=tempdir,
              output_ext=output_ext,
              resample=resample,
              allow_missing_keys=True,
          )
          trans(test_data)
  
          patch_index = test_data["img"].meta.get("patch_index", None)
          patch_index = (
              f"_{patch_index}" if patch_index is not None else ""
          )
          filepath = os.path.join(
              "testfile0",
              "testfile0" + "_trans" + patch_index + output_ext,
          )
          self.assertTrue(
              os.path.exists(os.path.join(tempdir, filepath))
          )
  
file_path: MONAI/tests/test_save_imaged.py
imports: from __future__ import annotations
  import os
  import tempfile
  import unittest
  from pathlib import Path
  import torch
  from parameterized import parameterized
  from monai.config import PathLike
  from monai.data.folder_layout import FolderLayoutBase
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms import SaveImaged
  from monai.utils import optional_import
label_desc: Use image node_id 1 for calling the TestSaveImaged obj's underlying member method code with example usage: obj.test_saved_content(test_data, output_ext, resample) without return types