code: def test_mock_plot_diagnostics(model_type, model):
      model.fit(lynx)
  
      with patch(
          "statsmodels.graphics.utils.create_mpl_fig", MockMPLFigure
      ), patch(
          "statsmodels.graphics.gofplots.qqplot", mock_qqplot
      ), patch(
          "statsmodels.graphics.tsaplots.plot_acf", mock_acf_plot
      ):
          diag = model.plot_diagnostics(figsize=(10, 12))
  
          # Asserting on mock attributes to show that we follow the expected
          # logical branches
          assert diag.figsize == (10, 12)
          assert len(diag.subplots) == 4
  
          # First one should have 'alpha' from the plot call
          assert (
              hasattr(diag.subplots[0], "alpha")
              and diag.subplots[0].alpha == 0.5
          )
  
          # Third figure gets QQPLOT called on it
          assert (
              hasattr(diag.subplots[2], "qqplot_called")
              and diag.subplots[2].qqplot_called
          )
  
          # Fourth figure gets ACF plot call on it
          assert (
              hasattr(diag.subplots[3], "acfplot_called")
              and diag.subplots[3].acfplot_called
          )
  
file_path: pmdarima/pmdarima/arima/tests/test_arima_diagnostics.py
imports: from pmdarima.datasets import load_lynx
  from pmdarima.arima import ARIMA
  from unittest.mock import patch
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_mock_plot_diagnostics(model_type, model) without return types