コード例 #1
0
    def test_import_external_nok(self):
        # load template
        template_path = join(RESOURCES_PATH, 'import-external.xsd')
        self.load_template(template_path)

        # load data
        data_path = join(RESOURCES_PATH, 'import_external_nok.xml')
        self.load_data(data_path)

        # test LXML
        if TEST_LXML:
            self.assertNotEquals(_lxml_validate_xml(self.xsd_tree, self.xml_tree), None)
        # test global method
        self.assertNotEquals(validate_xml_data(self.xsd_tree, self.xml_tree), None)
コード例 #2
0
    def test_no_root_ok(self):
        # load template
        template_path = join(RESOURCES_PATH, 'no_root.xsd')
        self.load_template(template_path)

        # load data
        data_path = join(RESOURCES_PATH, 'no_root_ok.xml')
        self.load_data(data_path)

        # test LXML
        # TODO: LXML fails to validate
        if TEST_LXML:
            self.assertEquals(_lxml_validate_xml(self.xsd_tree, self.xml_tree), None)
        # test global method
        self.assertEquals(validate_xml_data(self.xsd_tree, self.xml_tree), None)
コード例 #3
0
    def test_import_external_nok(self):
        # load template
        template_path = join(RESOURCES_PATH, 'import-external.xsd')
        self.load_template(template_path)

        # load data
        data_path = join(RESOURCES_PATH, 'import_external_nok.xml')
        self.load_data(data_path)

        # test LXML
        if TEST_LXML:
            self.assertNotEquals(
                _lxml_validate_xml(self.xsd_tree, self.xml_tree), None)
        # test global method
        self.assertNotEquals(validate_xml_data(self.xsd_tree, self.xml_tree),
                             None)
コード例 #4
0
    def test_no_root_ok(self):
        # load template
        template_path = join(RESOURCES_PATH, 'no_root.xsd')
        self.load_template(template_path)

        # load data
        data_path = join(RESOURCES_PATH, 'no_root_ok.xml')
        self.load_data(data_path)

        # test LXML
        # TODO: LXML fails to validate
        if TEST_LXML:
            self.assertEquals(_lxml_validate_xml(self.xsd_tree, self.xml_tree),
                              None)
        # test global method
        self.assertEquals(validate_xml_data(self.xsd_tree, self.xml_tree),
                          None)
コード例 #5
0
    def test_import_django_nok(self):
        # load type
        type_path = join(RESOURCES_PATH, 'to-import.xsd')
        type_object = self.load_type(type_path)

        # load template
        template_path = join(RESOURCES_PATH, 'import.xsd')
        self.load_template(template_path)

        update_dependencies(self.xsd_tree, {'to-import.xsd': str(type_object.id)})
        self.xsd_string = etree.tostring(self.xsd_tree)

        # load data
        data_path = join(RESOURCES_PATH, 'import_nok.xml')
        self.load_data(data_path)

        # test LXML
        if TEST_LXML:
            self.assertNotEquals(_lxml_validate_xml(self.xsd_tree, self.xml_tree), None)
        # test global method
        self.assertNotEquals(validate_xml_data(self.xsd_tree, self.xml_tree), None)
コード例 #6
0
    def test_import_django_nok(self):
        # load type
        type_path = join(RESOURCES_PATH, 'to-import.xsd')
        type_object = self.load_type(type_path)

        # load template
        template_path = join(RESOURCES_PATH, 'import.xsd')
        self.load_template(template_path)

        update_dependencies(self.xsd_tree,
                            {'to-import.xsd': str(type_object.id)})
        self.xsd_string = etree.tostring(self.xsd_tree)

        # load data
        data_path = join(RESOURCES_PATH, 'import_nok.xml')
        self.load_data(data_path)

        # test LXML
        if TEST_LXML:
            self.assertNotEquals(
                _lxml_validate_xml(self.xsd_tree, self.xml_tree), None)
        # test global method
        self.assertNotEquals(validate_xml_data(self.xsd_tree, self.xml_tree),
                             None)