Exemple #1
0
    def write_partial_tei(self, outdir, xml):
        outfile = os.path.join(outdir, 'PARTIAL_TEI.xml')
        f = open(outfile, 'w+')
        try:
            f.write(xml)
            # try to read it
            f.seek(0)
            tei = OPennTEI(f)
            tei.validate()
        finally:
            f.close()

        return outfile
Exemple #2
0
 def test_no_idno(self):
     openn_tei = OPennTEI(open(self.mscodex1589_tei_no_idno))
     with self.assertRaises(OPennException) as oe:
         openn_tei.validate()
     self.assertIn('Call number', str(oe.exception))
Exemple #3
0
 def test_no_title(self):
     openn_tei = OPennTEI(open(self.mscodex1589_tei_no_title))
     with self.assertRaises(OPennException) as oe:
         openn_tei.validate()
     self.assertIn('title', str(oe.exception))