docstr: For a config that contains a dict inside it, verify that config
  can be correctly created from a json/dict, and config can be correctly
  serialized and de-serialized
docstr_tok: ["For","a","config","that","contains","a","dict","inside","it",",","verify","that","config","can","be","correctly","created","from","a","json\/dict",",","and","config","can","be","correctly","serialized","and","de-serialized"]
code: def test_config_to_json_for_nested_objectsboo2(self):
      """For a config that contains a dict inside it, verify that config
      can be correctly created from a json/dict, and config can be correctly
      serialized and de-serialized
      """
  
      class Boo3(ConfigBase):
          ayeaye: str
  
      class Boo2(ConfigBase):
          aye: Boo3
  
      class TestConfigContainer(ConfigBase):
          class TestConfig(ConfigBase):
              a_list: List[Boo2]
  
          test_config: TestConfig
  
      a_str = "abc"
      # a_boo = {"boo1": {"aye": a_str}}
      a_boo = {"ayeaye": a_str}
      # b_boo = {"aye": {"boo3": a_boo}}
      b_boo = {"aye": a_boo}
      # a_boo_list = {"boolist1": {"boolistitems": [a_boo]}}
      a_config_containing_union = {"test_config": {"a_list": [b_boo]}}
      pytext_config = serialize.config_from_json(
          TestConfigContainer, a_config_containing_union
      )
      # verify that a_dict was read correctly
      self.assertEqual(
          pytext_config.test_config.a_list[0].aye.ayeaye, a_str
      )
      # serialize config to json, and deserialize back to config
      # verify that nothing changed
      jsonified_config = serialize.config_to_json(
          TestConfigContainer, pytext_config
      )
      pytext_config_deserialized = serialize.config_from_json(
          TestConfigContainer, jsonified_config
      )
      self.assertEqual(pytext_config, pytext_config_deserialized)
  
file_path: pytext/pytext/config/test/serialize_test.py
imports: import unittest
  from typing import Any, Dict, List, Union
  from pytext.config import ConfigBase, pytext_config_from_json, serialize
label_desc: Use image node_id 13 for calling the SerializeTest obj's underlying member method code with example usage: obj.test_config_to_json_for_nested_objectsboo2() without return types