code: def test_raises_missing_files(
      self, tmpdir, model_config_with_input_dim, custom_decoder
  ):
      tmpdir.mkdir("dummy_folder")
      dir_path = os.path.join(tmpdir, "dummy_folder")
  
      model = BaseAE(
          model_config_with_input_dim, decoder=custom_decoder
      )
  
      model.save(dir_path=dir_path)
  
      os.remove(os.path.join(dir_path, "decoder.pkl"))
  
      # check raises decoder.pkl is missing
      with pytest.raises(FileNotFoundError):
          model_rec = BaseAE.load_from_folder(dir_path)
  
      os.remove(os.path.join(dir_path, "model.pt"))
  
      # check raises model.pt is missing
      with pytest.raises(FileNotFoundError):
          model_rec = BaseAE.load_from_folder(dir_path)
  
      torch.save({"wrong_key": 0.0}, os.path.join(dir_path, "model.pt"))
      # check raises wrong key in model.pt
      with pytest.raises(KeyError):
          model_rec = BaseAE.load_from_folder(dir_path)
  
      os.remove(os.path.join(dir_path, "model_config.json"))
  
      # check raises encoder.pkl is missing
      with pytest.raises(FileNotFoundError):
          model_rec = BaseAE.load_from_folder(dir_path)
  
file_path: benchmark_VAE/tests/test_baseAE.py
imports: import os
  import shutil
  import pytest
  import torch
  from pythae.customexception import BadInheritanceError
  from pythae.models import BaseAE, BaseAEConfig
  from tests.data.custom_architectures import Decoder_AE_Conv, Encoder_AE_Conv, NetBadInheritance
label_desc: Use image node_id 4 for calling the Test_Model_Saving obj's underlying member method code with example usage: obj.test_raises_missing_files(tmpdir, model_config_with_input_dim, custom_decoder) without return types