code: def test_serialize_union_with_expansible_component(self):
      config = TestConfig(
          model=ModelFoo.Config(),
          model_bar_x=ModelBar.Config(),
          model_union=ModelBar1.Config(),
          datahandler=SubDataHandler.Config(),
      )
      json = config_to_json(TestConfig, config)
      print(json)
      self.assertEqual(json["model"]["ModelFoo"]["foo"], 2)
      self.assertEqual(json["model_bar_x"]["ModelBar"]["bar"], "bar")
      self.assertEqual(json["model_union"]["ModelBar1"]["bar"], "bar1")
      self.assertEqual(json["datahandler"]["SubDataHandler"]["foo"], 3)
      config = config_from_json(TestConfig, json)
      self.assertEqual(config.model.foo, 2)
      self.assertEqual(config.model_bar_x.bar, "bar")
      self.assertEqual(config.model_union.bar, "bar1")
      self.assertEqual(config.datahandler.foo, 3)
  
imports: import json
  import unittest
  from typing import Union
  from pytext.config.component import Component, ComponentType, ConfigBase
  from pytext.config.serialize import config_from_json, config_to_json, ConfigParseError
label_desc: Use image node_id 5 for calling the ComponentTest obj's underlying member method code with example usage: obj.test_serialize_union_with_expansible_component() without return types