def test_generate_xml_from_argument_with_default_values(self):
        """Checks that the XML produced from an Argument class that is initialized but has no additional manipulations
        made to it is what we expect. This is mostly a check of the default values."""

        argument = Argument("some_name")

        root = ET.Element("")
        constructed = argument.add_to_document(root)

        expected = ET.parse(data_open("data/argument_with_defaults.xml")).getroot()

        self.assertTrue(xml_compare(expected, constructed))
Beispiel #2
0
    def test_generate_xml_from_argument_with_default_values(self):
        """Checks that the XML produced from an Argument class that is initialized but has no additional manipulations
        made to it is what we expect. This is mostly a check of the default values."""

        argument = Argument("some_name")

        root = ET.Element("")
        constructed = argument.add_to_document(root)

        expected = ET.parse(
            data_open("data/argument_with_defaults.xml")).getroot()

        self.assertTrue(xml_compare(expected, constructed))
Beispiel #3
0
    def test_generate_xml_from_argument(self):
        """Checks that the XML generated by an Argument class with all its possible values set is what we expect."""

        argument = Argument(name="some_name",
                            description=u"쎼 and 쎶 and <&> für",
                            validation="is_pos_int('some_name')",
                            data_type=Argument.data_type_boolean,
                            required_on_edit="true",
                            required_on_create="true")

        root = ET.Element("")
        constructed = argument.add_to_document(root)

        expected = ET.parse(
            data_open("data/argument_without_defaults.xml")).getroot()

        self.assertTrue(xml_compare(expected, constructed))
    def test_generate_xml_from_argument(self):
        """Checks that the XML generated by an Argument class with all its possible values set is what we expect."""

        argument = Argument(
            name="some_name",
            description=u"쎼 and 쎶 and <&> für",
            validation="is_pos_int('some_name')",
            data_type=Argument.data_type_boolean,
            required_on_edit="true",
            required_on_create="true"
        )

        root = ET.Element("")
        constructed = argument.add_to_document(root)

        expected = ET.parse(data_open("data/argument_without_defaults.xml")).getroot()

        self.assertTrue(xml_compare(expected, constructed))