docstr: Test deprecation warning for h5 format.
docstr_tok: ["Test","deprecation","warning","for","h5","format","."]
code: def test_h5_deprecation_warning(self):
      """Test deprecation warning for h5 format."""
      model = self.get_model()
      filepath = os.path.join(self.get_temp_dir(), "test_model.h5")
  
      with mock.patch.object(logging, "warning") as mock_warn:
          saving_api.save_model(model, filepath)
          mock_warn.assert_called_once_with(
              "You are saving your model as an HDF5 file via "
              "`model.save()` or `keras.saving.save_model(model)`. "
              "This file format is considered legacy. "
              "We recommend using instead the native Keras format, "
              "e.g. `model.save('my_model.keras')` or "
              "`keras.saving.save_model(model, 'my_model.keras')`. "
          )
  
imports: import os
  import unittest.mock
  import numpy
  from absl import logging
  from keras import layers
  from keras.models import Sequential
  from keras.saving import saving_api
  from keras.testing import test_case
label_desc: Use image node_id 2 for calling the SaveModelTestsWarning obj's underlying member method code with example usage: obj.test_h5_deprecation_warning() without return types