Beispiel #1
0
    def test_get_xml_tree_result_should_equal_golden_output(self):
        golden_xmldoc = self.get_xmldoc_of_golden_output_as_string()

        generator = TelescopeModelXMLGeneratorType1()
        xmldoc = generator.get_xml_tree(self.model)
        result = str(etree.tostring(xmldoc), "UTF-8")

        assertEqualXML(result, golden_xmldoc)
    def test_specification_to_momspecification_direct_translation_should_return_expected_type3_mom(self):
        handler = SpecificationTranslationHandler()

        momxml = handler.specification_to_momspecification(self.xml_type3, translation_mode=FULL_TRANSLATION)

        with open(self.expected_momxml_direct_type3, "r+") as f:
            if GENERATE_GOLDEN_OUTPUT:
                f.write(momxml["mom-specification"])
            else:
                assertEqualXML(momxml["mom-specification"], f.read())
    def test_specification_to_momspecification_model_translation_should_return_expected_type1_mom_xml_with_constraints(self):
        handler = SpecificationTranslationHandler()

        momxml = handler.specification_to_momspecification(self.xml_type1_minmax, translation_mode=MODEL_TRANSLATION)

        assertEqualXML(momxml["mom-specification"], self.expected_momxml_type1_minmax)