Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
This method validate the parsing and schema, return a boolean

src/p/o/porteira-0.4/porteira/test.py   porteira(Download)
    def test_validate_with_valid_XML(self):
        sch = Schema(self.xsd_string)
        validated = sch.validate(self.xml_string)
        self.assertTrue(validated)
 
    def test_validate_with_invalid_XML(self):
        sch = Schema(self.xsd_string)
        validated = sch.validate(self.xml_string_invalid)
    def test_validate_with_valid_XML_using_file(self):
        sch = Schema(self.xsd_file)
        validated = sch.validate(self.xml_file)
        self.assertTrue(validated)
 
    def test_validate_with_invalid_XML_using_file(self):
        sch = Schema(self.xsd_file)
        validated = sch.validate(self.xml_file_invalid)