code: def test_serialize_data_dictionary_with_categorical_value(self):
      # arrange
      data_dictionary = models.DataDictionary(
          dataFields=[
              models.DataField(
                  name="toto0",
                  optype=models.OpType.categorical,
                  dataType=models.DataType.string,
                  values=[
                      models.Value(value="val1"),
                      models.Value(
                          value="val2",
                          property=models.Restriction.valid,
                      ),
                      models.Value(
                          value="unknown",
                          property=models.Restriction.invalid,
                      ),
                      models.Value(
                          value="unknown",
                          property=models.Restriction.missing,
                      ),
                  ],
              )
          ]
      )
      model = models.SimplePMMLRuleSetModel(
          dataDictionary=data_dictionary, ruleSetModel=None
      )  # noqa
  
      # when
      serialized = self.nyokaSerializer.serialize(model)
      res_data_dictionary_dict = xmltodict.parse(xml_input=serialized)[
          "PMML"
      ]["DataDictionary"]
  
      # assert
      expected = """
          <DataDictionary numberOfFields="1">
              <DataField name="toto0" optype="categorical" dataType="string">
                  <Value value="val1"/>
                  <Value value="val2"/>
                  <Value value="unknown" property="invalid"/>
                  <Value value="unknown" property="missing"/>
              </DataField>
          </DataDictionary>
          """
      self.assertEqual(
          res_data_dictionary_dict,
          xmltodict.parse(xml_input=expected)["DataDictionary"],
      )
  
file_path: AIX360/tests/rule_induction/trxf/pmml_export/test_nyoka_serialize_common.py
imports: import datetime
  from unittest import TestCase
  import nyoka.base.constants
  import xmltodict
  import aix360.algorithms.rule_induction.trxf.pmml_export.models
  import aix360.algorithms.rule_induction.trxf.pmml_export.serializer
label_desc: Use image node_id 4 for calling the TestNyokaSerializer obj's underlying member method code with example usage: obj.test_serialize_data_dictionary_with_categorical_value() without return types