code: def testChannelParameterType(self):
      arg_name = "foo"
  
      class _FooArtifact(artifact.Artifact):
          TYPE_NAME = "FooArtifact"
  
      class _BarArtifact(artifact.Artifact):
          TYPE_NAME = "BarArtifact"
  
      channel_parameter = ChannelParameter(type=_FooArtifact)
      # Following should pass.
      channel_parameter.type_check(
          arg_name, channel.Channel(type=_FooArtifact)
      )
  
      with self.assertRaisesRegex(TypeError, arg_name):
          channel_parameter.type_check(arg_name, 42)  # Wrong value.
  
      with self.assertRaisesRegex(TypeError, arg_name):
          channel_parameter.type_check(
              arg_name, channel.Channel(type=_BarArtifact)
          )
  
      setattr(
          _FooArtifact,
          component_spec.COMPATIBLE_TYPES_KEY,
          {_BarArtifact},
      )
      channel_parameter.type_check(
          arg_name, channel.Channel(type=_BarArtifact)
      )
  
imports: import json
  import sys
  from typing import Dict, List
  import unittest
  import tensorflow
  from tfx.dsl.placeholder import placeholder
  from tfx.proto import example_gen_pb2
  from tfx.types import artifact
  from tfx.types import channel
  from tfx.types import component_spec
  from tfx.types.component_spec import ChannelParameter
  from tfx.types.component_spec import ComponentSpec
  from tfx.types.component_spec import ExecutionParameter
  from tfx.types.standard_artifacts import Examples
  from tfx.utils import proto_utils
  from google.protobuf import json_format
  from google.protobuf import text_format
label_desc: Use image node_id 13 for calling the ComponentSpecTest obj's underlying member method code with example usage: obj.testChannelParameterType() without return types