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

All Samples(6)  |  Call(0)  |  Derive(0)  |  Import(6)
Parser for XML results returned by NCBI's Entrez Utilities. This
parser is used by the read() function in Bio.Entrez, and is not intended
be used directly.

src/b/i/Bio_Eutils-1.63/Tests/test_Entrez.py   Bio_Eutils(Download)
        # Starting some time in 2010, the results returned by Bio_Eutils.Entrez
        # included some tags that are not part of the corresponding DTD.
        from Bio_Eutils.Entrez import Parser
        handle = open('Entrez/einfo3.xml', "rb")
        self.assertRaises(Parser.ValidationError, Entrez.read, handle)
        # >>> Bio_Eutils.Entrez.einfo()
        # and manually delete the last couple of lines
        from Bio_Eutils.Entrez import Parser
        handle = open('Entrez/einfo4.xml', "rb")
        self.assertRaises(Parser.CorruptedXMLError, Entrez.read, handle)
        # To create the GenBank file, use
        # >>> Bio_Eutils.Entrez.efetch(db='nucleotide', id='NT_019265', rettype='gb')
        from Bio_Eutils.Entrez import Parser
        handle = open('GenBank/NT_019265.gb', "rb")
        self.assertRaises(Parser.NotXMLError, Entrez.read, handle)
    def test_fasta(self):
        '''Test error handling when presented with Fasta non-XML data
        '''
        from Bio_Eutils.Entrez import Parser
        handle = open('Fasta/wisteria.nu', "rb")
        # To create the HTML file, use
        # >>> Bio_Eutils.Entrez.efetch(db="pubmed", id="19304878")
        from Bio_Eutils.Entrez import Parser
        handle = open('Entrez/pubmed3.html', "rb")
        self.assertRaises(Parser.NotXMLError, Entrez.read, handle)