code: def test_validation_cannot_set_both_model_and_inference_spec(
      self, mock_serveSettings
  ):
      builder = ModelBuilder(
          inference_spec="some value", model=Mock(spec=object)
      )
      self.assertRaisesRegex(
          Exception,
          "Cannot have both the Model and Inference spec in the builder",
          builder.build,
          Mode.SAGEMAKER_ENDPOINT,
          mock_role_arn,
          mock_session,
      )
  
imports: from __future__ import absolute_import
  from unittest.mock import MagicMock, patch, Mock
  import unittest
  from pathlib import Path
  from sagemaker.serve.builder.model_builder import ModelBuilder
  from sagemaker.serve.mode.function_pointers import Mode
  from sagemaker.serve.utils.types import ModelServer
label_desc: Use image node_id 2 for calling the TestModelBuilder obj's underlying member method code with example usage: obj.test_validation_cannot_set_both_model_and_inference_spec(mock_serveSettings) without return types