code: def test_serialize_rule_set(self):
      # arrange
      srz = serializer.NyokaSerializer()
      model = models.SimplePMMLRuleSetModel(
          dataDictionary=models.DataDictionary(dataFields=None),  # noqa
          ruleSetModel=models.RuleSetModel(
              miningSchema=None,  # noqa
              ruleSet=models.RuleSet(
                  ruleSelectionMethod=[
                      models.RuleSelectionMethod.firstHit
                  ],
                  rules=None,  # noqa
                  recordCount=5,
                  nbCorrect=3,
                  defaultScore="toto",
                  defaultConfidence=0.5,
              ),
          ),
      )
      model_default = models.SimplePMMLRuleSetModel(
          dataDictionary=models.DataDictionary(dataFields=None),  # noqa
          ruleSetModel=models.RuleSetModel(
              miningSchema=None,  # noqa
              ruleSet=models.RuleSet(
                  ruleSelectionMethod=[
                      models.RuleSelectionMethod.firstHit
                  ],
                  rules=None,
              ),
          ),
      )  # noqa
  
      # when
      serialized = srz.serialize(model)
      serialized_default = srz.serialize(model_default)
      res_data_dictionary_dict = xmltodict.parse(xml_input=serialized)[
          "PMML"
      ]["RuleSetModel"]["RuleSet"]
      res_data_dictionary_dict_default = xmltodict.parse(
          xml_input=serialized_default
      )["PMML"]["RuleSetModel"]["RuleSet"]
  
      # assert
      expected = """
              <RuleSet recordCount="5" nbCorrect="3" defaultScore="toto" defaultConfidence="0.5">
                  <RuleSelectionMethod criterion="firstHit"/>
              </RuleSet>
              """
      expected_default = """
                  <RuleSet>
                      <RuleSelectionMethod criterion="firstHit"/>
                  </RuleSet>
                  """
      self.assertEqual(
          res_data_dictionary_dict,
          xmltodict.parse(xml_input=expected)["RuleSet"],
      )
      self.assertEqual(
          res_data_dictionary_dict_default,
          xmltodict.parse(xml_input=expected_default)["RuleSet"],
      )
  
imports: from unittest import TestCase
  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 1 for calling the TestNyokaSerializer obj's underlying member method code with example usage: obj.test_serialize_rule_set() without return types