code: def test_served_model(
      mock_post, rai_forecasting_insights_for_served_model
  ):
      X_train, X_test, _, _ = create_tiny_forecasting_dataset()
  
      mock_post.return_value = mock.Mock(
          status_code=200,
          content=json.dumps(
              {
                  "predictions": [
                      random.random() for _ in range(len(X_train))
                  ]
              }
          ),
      )
  
      rai_insights = RAIInsights.load(RAI_INSIGHTS_DIR_NAME)
      forecasts = rai_insights.model.forecast(X_test)
      assert len(forecasts) == len(X_test)
      assert mock_post.call_count == 1
  
file_path: responsible-ai-toolbox/responsibleai/tests/rai_insights/test_served_model.py
imports: import json
  import random
  from unittest import mock
  import pytest
  import requests
  from tests.common_utils import RandomForecastingModel, create_tiny_forecasting_dataset
  from responsibleai import FeatureMetadata, RAIInsights
label_desc: Use image node_id 2 for calling a global function with example usage: test_served_model(mock_post, rai_forecasting_insights_for_served_model) without return types