コード例 #1
0
    def test_basic(self):
        # load template
        template_path = join(RESOURCES_PATH, 'basic.xsd')
        self.load_template(template_path)

        # test LXML
        if TEST_LXML:
            self.assertEquals(_lxml_validate_xsd(self.xsd_tree), None)
        # test global method
        self.assertEquals(validate_xml_schema(self.xsd_tree), None)
コード例 #2
0
    def test_include_filesystem(self):
        # load template
        template_path = join(RESOURCES_PATH, 'include.xsd')
        self.load_template(template_path)

        # test LXML
        if TEST_LXML:
            self.assertNotEquals(_lxml_validate_xsd(self.xsd_tree), None)
        # test global method
        self.assertNotEquals(validate_xml_schema(self.xsd_tree), None)
コード例 #3
0
    def test_basic(self):
        # load template
        template_path = join(RESOURCES_PATH, 'basic.xsd')
        self.load_template(template_path)

        # test LXML
        if TEST_LXML:
            self.assertEquals(_lxml_validate_xsd(self.xsd_tree), None)
        # test global method
        self.assertEquals(validate_xml_schema(self.xsd_tree), None)
コード例 #4
0
    def test_include_filesystem(self):
        # load template
        template_path = join(RESOURCES_PATH, 'include.xsd')
        self.load_template(template_path)

        # test LXML
        if TEST_LXML:
            self.assertNotEquals(_lxml_validate_xsd(self.xsd_tree), None)
        # test global method
        self.assertNotEquals(validate_xml_schema(self.xsd_tree), None)
コード例 #5
0
    def test_1_1(self):
        # load template
        template_path = join(RESOURCES_PATH, '1.1.xsd')
        self.load_template(template_path)

        # test LXML
        # TODO: LXML fails to validate
        if TEST_LXML:
            self.assertEquals(_lxml_validate_xsd(self.xsd_tree), None)
        # test global method
        self.assertEquals(validate_xml_schema(self.xsd_tree), None)
コード例 #6
0
    def test_1_1(self):
        # load template
        template_path = join(RESOURCES_PATH, '1.1.xsd')
        self.load_template(template_path)

        # test LXML
        # TODO: LXML fails to validate
        if TEST_LXML:
            self.assertEquals(_lxml_validate_xsd(self.xsd_tree), None)
        # test global method
        self.assertEquals(validate_xml_schema(self.xsd_tree), None)
コード例 #7
0
    def test_import_django(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)

        # test LXML
        if TEST_LXML:
            self.assertEquals(_lxml_validate_xsd(self.xsd_tree), None)
        # test global method
        self.assertEquals(validate_xml_schema(self.xsd_tree), None)
コード例 #8
0
    def test_import_django(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)

        # test LXML
        if TEST_LXML:
            self.assertEquals(_lxml_validate_xsd(self.xsd_tree), None)
        # test global method
        self.assertEquals(validate_xml_schema(self.xsd_tree), None)