Back to index

python-biopython  1.60
test_Entrez.py
Go to the documentation of this file.
00001 '''Testing code for Bio.Entrez parsers.
00002 '''
00003 
00004 import unittest
00005 
00006 import os
00007 if os.name == 'java':
00008     from Bio import MissingExternalDependencyError
00009     #This is a slight miss-use of MissingExternalDependencyError,
00010     #but it will do in the short term to skip this unit test on Jython
00011     raise MissingExternalDependencyError("The Bio.Entrez XML parser fails "
00012         "on Jython, see http://bugs.jython.org/issue1447")
00013 
00014 
00015 try:
00016     from xml.parsers.expat import model
00017     del model
00018 except ImportError:
00019     from Bio import MissingExternalDependencyError
00020     raise MissingExternalDependencyError("Not supported on PyPy 1.6, see "
00021                                          "https://bugs.pypy.org/issue914")
00022 
00023 
00024 from xml.parsers import expat
00025 p = expat.ParserCreate(namespace_separator=" ")
00026 try:
00027     p.StartElementHandler is None
00028 except AttributeError:
00029     from Bio import MissingExternalDependencyError
00030     raise MissingExternalDependencyError("Not supported on PyPy 1.7, see "
00031                                          "https://bugs.pypy.org/issue933")
00032 del p
00033 del expat
00034 
00035 
00036 from Bio import Entrez
00037 
00038 class GeneralTests(unittest.TestCase):
00039     '''General tests for Bio.Entrez'''
00040     def test_closed_handle(self):
00041         '''Test parsing closed handle fails gracefully
00042         '''
00043         handle = open('Entrez/einfo1.xml', "rb")
00044         handle.close()
00045         self.assertRaises(IOError, Entrez.read, handle)
00046 
00047 
00048 class EInfoTest(unittest.TestCase):
00049     '''Tests for parsing XML output returned by EInfo
00050     '''
00051     def test_list(self):
00052         '''Test parsing database list returned by EInfo
00053         '''
00054         # To create the XML file, use
00055         # >>> Bio.Entrez.einfo()
00056         handle = open('Entrez/einfo1.xml', "rb")
00057         record = Entrez.read(handle)
00058         handle.close()
00059         self.assertEqual(record["DbList"], ['pubmed',
00060                                             'protein',
00061                                             'nucleotide',
00062                                             'nuccore',
00063                                             'nucgss',
00064                                             'nucest',
00065                                             'structure',
00066                                             'genome',
00067                                             'books',
00068                                             'cancerchromosomes',
00069                                             'cdd',
00070                                             'gap',
00071                                             'domains',
00072                                             'gene',
00073                                             'genomeprj',
00074                                             'gensat',
00075                                             'geo',
00076                                             'gds',
00077                                             'homologene',
00078                                             'journals',
00079                                             'mesh',
00080                                             'ncbisearch',
00081                                             'nlmcatalog',
00082                                             'omia',
00083                                             'omim',
00084                                             'pmc',
00085                                             'popset',
00086                                             'probe',
00087                                             'proteinclusters',
00088                                             'pcassay',
00089                                             'pccompound',
00090                                             'pcsubstance',
00091                                             'snp',
00092                                             'taxonomy',
00093                                             'toolkit',
00094                                             'unigene',
00095                                             'unists'
00096                                            ])
00097 
00098     def test_pubmed1(self):
00099         '''Test parsing database info returned by EInfo
00100         '''
00101         # To create the XML file, use
00102         # >>> Bio.Entrez.einfo(db="pubmed")
00103         handle = open('Entrez/einfo2.xml', "rb")
00104         record = Entrez.read(handle)
00105         handle.close()
00106         self.assertEqual(record["DbInfo"]['DbName'], 'pubmed')
00107         self.assertEqual(record["DbInfo"]['MenuName'], 'PubMed')
00108         self.assertEqual(record["DbInfo"]['Description'], 'PubMed bibliographic record')
00109         self.assertEqual(record["DbInfo"]['Count'], "17905967")
00110         self.assertEqual(record["DbInfo"]['LastUpdate'], '2008/04/15 06:42')
00111 
00112         self.assertEqual(len(record["DbInfo"]['FieldList']), 40)
00113 
00114         self.assertEqual(record["DbInfo"]['FieldList'][0]['Name'], 'ALL')
00115         self.assertEqual(record["DbInfo"]['FieldList'][0]['FullName'], 'All Fields')
00116         self.assertEqual(record["DbInfo"]['FieldList'][0]['Description'], 'All terms from all searchable fields')
00117         self.assertEqual(record["DbInfo"]['FieldList'][0]['TermCount'], "70792830")
00118         self.assertEqual(record["DbInfo"]['FieldList'][0]['IsDate'], 'N')
00119         self.assertEqual(record["DbInfo"]['FieldList'][0]['IsNumerical'], 'N')
00120         self.assertEqual(record["DbInfo"]['FieldList'][0]['SingleToken'], 'N')
00121         self.assertEqual(record["DbInfo"]['FieldList'][0]['Hierarchy'], 'N')
00122         self.assertEqual(record["DbInfo"]['FieldList'][0]['IsHidden'], 'N')
00123 
00124         self.assertEqual(len(record["DbInfo"]['LinkList']), 46)
00125 
00126         self.assertEqual(record["DbInfo"]['LinkList'][0]['Name'], 'pubmed_books_refs')
00127         self.assertEqual(record["DbInfo"]['LinkList'][0]['Menu'], 'Cited in Books')
00128         self.assertEqual(record["DbInfo"]['LinkList'][0]['Description'], 'PubMed links associated with Books')
00129         self.assertEqual(record["DbInfo"]['LinkList'][0]['DbTo'], 'books')
00130 
00131     def test_pubmed2(self):
00132         '''Test validating the XML against the DTD
00133         '''
00134         # To create the XML file, use
00135         # >>> Bio.Entrez.einfo(db="pubmed")
00136         # Starting some time in 2010, the results returned by Bio.Entrez
00137         # included some tags that are not part of the corresponding DTD.
00138         from Bio.Entrez import Parser
00139         handle = open('Entrez/einfo3.xml', "rb")
00140         self.assertRaises(Parser.ValidationError, Entrez.read, handle)
00141         handle.close()
00142 
00143     def test_pubmed3(self):
00144         '''Test non-validating parser on XML with an inconsistent DTD
00145         '''
00146         # To create the XML file, use
00147         # >>> Bio.Entrez.einfo(db="pubmed")
00148         # Starting some time in 2010, the results returned by Bio.Entrez
00149         # included some tags that are not part of the corresponding DTD.
00150         handle = open('Entrez/einfo3.xml', "rb")
00151         record = Entrez.read(handle, validate=False)
00152         handle.close()
00153         self.assertEqual(record["DbInfo"]['DbName'], 'pubmed')
00154         self.assertEqual(record["DbInfo"]['MenuName'], 'PubMed')
00155         self.assertEqual(record["DbInfo"]['Description'], 'PubMed bibliographic record')
00156         self.assertEqual(record["DbInfo"]['Count'], "20161961")
00157         self.assertEqual(record["DbInfo"]['LastUpdate'], "2010/09/10 04:52")
00158 
00159         self.assertEqual(len(record["DbInfo"]['FieldList']), 45)
00160         self.assertEqual(record["DbInfo"]["FieldList"][0]["Name"], "ALL")
00161         self.assertEqual(record["DbInfo"]["FieldList"][0]["FullName"], "All Fields")
00162         self.assertEqual(record["DbInfo"]["FieldList"][0]["Description"], "All terms from all searchable fields")
00163         self.assertEqual(record["DbInfo"]["FieldList"][0]["TermCount"], "89981460")
00164         self.assertEqual(record["DbInfo"]["FieldList"][0]["IsDate"], "N")
00165         self.assertEqual(record["DbInfo"]["FieldList"][0]["IsNumerical"], "N")
00166         self.assertEqual(record["DbInfo"]["FieldList"][0]["SingleToken"], "N")
00167         self.assertEqual(record["DbInfo"]["FieldList"][0]["Hierarchy"], "N")
00168         self.assertEqual(record["DbInfo"]["FieldList"][0]["IsHidden"], "N")
00169         self.assertEqual(record["DbInfo"]["FieldList"][1]["Name"], "UID")
00170         self.assertEqual(record["DbInfo"]["FieldList"][1]["FullName"], "UID")
00171         self.assertEqual(record["DbInfo"]["FieldList"][1]["Description"], "Unique number assigned to publication")
00172         self.assertEqual(record["DbInfo"]["FieldList"][1]["TermCount"], "0")
00173         self.assertEqual(record["DbInfo"]["FieldList"][1]["IsDate"], "N")
00174         self.assertEqual(record["DbInfo"]["FieldList"][1]["IsNumerical"], "Y")
00175         self.assertEqual(record["DbInfo"]["FieldList"][1]["SingleToken"], "Y")
00176         self.assertEqual(record["DbInfo"]["FieldList"][1]["Hierarchy"], "N")
00177         self.assertEqual(record["DbInfo"]["FieldList"][1]["IsHidden"], "Y")
00178         self.assertEqual(record["DbInfo"]["FieldList"][2]["Name"], "FILT")
00179         self.assertEqual(record["DbInfo"]["FieldList"][2]["FullName"], "Filter")
00180         self.assertEqual(record["DbInfo"]["FieldList"][2]["Description"], "Limits the records")
00181         self.assertEqual(record["DbInfo"]["FieldList"][2]["TermCount"], "4070")
00182         self.assertEqual(record["DbInfo"]["FieldList"][2]["IsDate"], "N")
00183         self.assertEqual(record["DbInfo"]["FieldList"][2]["IsNumerical"], "N")
00184         self.assertEqual(record["DbInfo"]["FieldList"][2]["SingleToken"], "Y")
00185         self.assertEqual(record["DbInfo"]["FieldList"][2]["Hierarchy"], "N")
00186         self.assertEqual(record["DbInfo"]["FieldList"][2]["IsHidden"], "N")
00187         self.assertEqual(record["DbInfo"]["FieldList"][3]["Name"], "TITL")
00188         self.assertEqual(record["DbInfo"]["FieldList"][3]["FullName"], "Title")
00189         self.assertEqual(record["DbInfo"]["FieldList"][3]["Description"], "Words in title of publication")
00190         self.assertEqual(record["DbInfo"]["FieldList"][3]["TermCount"], "12475481")
00191         self.assertEqual(record["DbInfo"]["FieldList"][3]["IsDate"], "N")
00192         self.assertEqual(record["DbInfo"]["FieldList"][3]["IsNumerical"], "N")
00193         self.assertEqual(record["DbInfo"]["FieldList"][3]["SingleToken"], "N")
00194         self.assertEqual(record["DbInfo"]["FieldList"][3]["Hierarchy"], "N")
00195         self.assertEqual(record["DbInfo"]["FieldList"][3]["IsHidden"], "N")
00196         self.assertEqual(record["DbInfo"]["FieldList"][4]["Name"], "WORD")
00197         self.assertEqual(record["DbInfo"]["FieldList"][4]["FullName"], "Text Word")
00198         self.assertEqual(record["DbInfo"]["FieldList"][4]["Description"], "Free text associated with publication")
00199         self.assertEqual(record["DbInfo"]["FieldList"][4]["TermCount"], "39413498")
00200         self.assertEqual(record["DbInfo"]["FieldList"][4]["IsDate"], "N")
00201         self.assertEqual(record["DbInfo"]["FieldList"][4]["IsNumerical"], "N")
00202         self.assertEqual(record["DbInfo"]["FieldList"][4]["SingleToken"], "N")
00203         self.assertEqual(record["DbInfo"]["FieldList"][4]["Hierarchy"], "N")
00204         self.assertEqual(record["DbInfo"]["FieldList"][4]["IsHidden"], "N")
00205         self.assertEqual(record["DbInfo"]["FieldList"][5]["Name"], "MESH")
00206         self.assertEqual(record["DbInfo"]["FieldList"][5]["FullName"], "MeSH Terms")
00207         self.assertEqual(record["DbInfo"]["FieldList"][5]["Description"], "Medical Subject Headings assigned to publication")
00208         self.assertEqual(record["DbInfo"]["FieldList"][5]["TermCount"], "554666")
00209         self.assertEqual(record["DbInfo"]["FieldList"][5]["IsDate"], "N")
00210         self.assertEqual(record["DbInfo"]["FieldList"][5]["IsNumerical"], "N")
00211         self.assertEqual(record["DbInfo"]["FieldList"][5]["SingleToken"], "Y")
00212         self.assertEqual(record["DbInfo"]["FieldList"][5]["Hierarchy"], "Y")
00213         self.assertEqual(record["DbInfo"]["FieldList"][5]["IsHidden"], "N")
00214         self.assertEqual(record["DbInfo"]["FieldList"][6]["Name"], "MAJR")
00215         self.assertEqual(record["DbInfo"]["FieldList"][6]["FullName"], "MeSH Major Topic")
00216         self.assertEqual(record["DbInfo"]["FieldList"][6]["Description"], "MeSH terms of major importance to publication")
00217         self.assertEqual(record["DbInfo"]["FieldList"][6]["TermCount"], "493091")
00218         self.assertEqual(record["DbInfo"]["FieldList"][6]["IsDate"], "N")
00219         self.assertEqual(record["DbInfo"]["FieldList"][6]["IsNumerical"], "N")
00220         self.assertEqual(record["DbInfo"]["FieldList"][6]["SingleToken"], "Y")
00221         self.assertEqual(record["DbInfo"]["FieldList"][6]["Hierarchy"], "Y")
00222         self.assertEqual(record["DbInfo"]["FieldList"][6]["IsHidden"], "N")
00223         self.assertEqual(record["DbInfo"]["FieldList"][7]["Name"], "AUTH")
00224         self.assertEqual(record["DbInfo"]["FieldList"][7]["FullName"], "Author")
00225         self.assertEqual(record["DbInfo"]["FieldList"][7]["Description"], "Author(s) of publication")
00226         self.assertEqual(record["DbInfo"]["FieldList"][7]["TermCount"], "11268262")
00227         self.assertEqual(record["DbInfo"]["FieldList"][7]["IsDate"], "N")
00228         self.assertEqual(record["DbInfo"]["FieldList"][7]["IsNumerical"], "N")
00229         self.assertEqual(record["DbInfo"]["FieldList"][7]["SingleToken"], "Y")
00230         self.assertEqual(record["DbInfo"]["FieldList"][7]["Hierarchy"], "N")
00231         self.assertEqual(record["DbInfo"]["FieldList"][7]["IsHidden"], "N")
00232         self.assertEqual(record["DbInfo"]["FieldList"][8]["Name"], "JOUR")
00233         self.assertEqual(record["DbInfo"]["FieldList"][8]["FullName"], "Journal")
00234         self.assertEqual(record["DbInfo"]["FieldList"][8]["Description"], "Journal abbreviation of publication")
00235         self.assertEqual(record["DbInfo"]["FieldList"][8]["TermCount"], "118354")
00236         self.assertEqual(record["DbInfo"]["FieldList"][8]["IsDate"], "N")
00237         self.assertEqual(record["DbInfo"]["FieldList"][8]["IsNumerical"], "N")
00238         self.assertEqual(record["DbInfo"]["FieldList"][8]["SingleToken"], "Y")
00239         self.assertEqual(record["DbInfo"]["FieldList"][8]["Hierarchy"], "N")
00240         self.assertEqual(record["DbInfo"]["FieldList"][8]["IsHidden"], "N")
00241         self.assertEqual(record["DbInfo"]["FieldList"][9]["Name"], "AFFL")
00242         self.assertEqual(record["DbInfo"]["FieldList"][9]["FullName"], "Affiliation")
00243         self.assertEqual(record["DbInfo"]["FieldList"][9]["Description"], "Author's institutional affiliation and address")
00244         self.assertEqual(record["DbInfo"]["FieldList"][9]["TermCount"], "17538809")
00245         self.assertEqual(record["DbInfo"]["FieldList"][9]["IsDate"], "N")
00246         self.assertEqual(record["DbInfo"]["FieldList"][9]["IsNumerical"], "N")
00247         self.assertEqual(record["DbInfo"]["FieldList"][9]["SingleToken"], "N")
00248         self.assertEqual(record["DbInfo"]["FieldList"][9]["Hierarchy"], "N")
00249         self.assertEqual(record["DbInfo"]["FieldList"][9]["IsHidden"], "N")
00250         self.assertEqual(record["DbInfo"]["FieldList"][10]["Name"], "ECNO")
00251         self.assertEqual(record["DbInfo"]["FieldList"][10]["FullName"], "EC/RN Number")
00252         self.assertEqual(record["DbInfo"]["FieldList"][10]["Description"], "EC number for enzyme or CAS registry number")
00253         self.assertEqual(record["DbInfo"]["FieldList"][10]["TermCount"], "82892")
00254         self.assertEqual(record["DbInfo"]["FieldList"][10]["IsDate"], "N")
00255         self.assertEqual(record["DbInfo"]["FieldList"][10]["IsNumerical"], "N")
00256         self.assertEqual(record["DbInfo"]["FieldList"][10]["SingleToken"], "Y")
00257         self.assertEqual(record["DbInfo"]["FieldList"][10]["Hierarchy"], "N")
00258         self.assertEqual(record["DbInfo"]["FieldList"][10]["IsHidden"], "N")
00259         self.assertEqual(record["DbInfo"]["FieldList"][11]["Name"], "SUBS")
00260         self.assertEqual(record["DbInfo"]["FieldList"][11]["FullName"], "Substance Name")
00261         self.assertEqual(record["DbInfo"]["FieldList"][11]["Description"], "CAS chemical name or MEDLINE Substance Name")
00262         self.assertEqual(record["DbInfo"]["FieldList"][11]["TermCount"], "204197")
00263         self.assertEqual(record["DbInfo"]["FieldList"][11]["IsDate"], "N")
00264         self.assertEqual(record["DbInfo"]["FieldList"][11]["IsNumerical"], "N")
00265         self.assertEqual(record["DbInfo"]["FieldList"][11]["SingleToken"], "Y")
00266         self.assertEqual(record["DbInfo"]["FieldList"][11]["Hierarchy"], "N")
00267         self.assertEqual(record["DbInfo"]["FieldList"][11]["IsHidden"], "N")
00268         self.assertEqual(record["DbInfo"]["FieldList"][12]["Name"], "PDAT")
00269         self.assertEqual(record["DbInfo"]["FieldList"][12]["FullName"], "Publication Date")
00270         self.assertEqual(record["DbInfo"]["FieldList"][12]["Description"], "Date of publication")
00271         self.assertEqual(record["DbInfo"]["FieldList"][12]["TermCount"], "35200")
00272         self.assertEqual(record["DbInfo"]["FieldList"][12]["IsDate"], "Y")
00273         self.assertEqual(record["DbInfo"]["FieldList"][12]["IsNumerical"], "N")
00274         self.assertEqual(record["DbInfo"]["FieldList"][12]["SingleToken"], "Y")
00275         self.assertEqual(record["DbInfo"]["FieldList"][12]["Hierarchy"], "N")
00276         self.assertEqual(record["DbInfo"]["FieldList"][12]["IsHidden"], "N")
00277         self.assertEqual(record["DbInfo"]["FieldList"][13]["Name"], "EDAT")
00278         self.assertEqual(record["DbInfo"]["FieldList"][13]["FullName"], "Entrez Date")
00279         self.assertEqual(record["DbInfo"]["FieldList"][13]["Description"], "Date publication first accessible through Entrez")
00280         self.assertEqual(record["DbInfo"]["FieldList"][13]["TermCount"], "33978")
00281         self.assertEqual(record["DbInfo"]["FieldList"][13]["IsDate"], "Y")
00282         self.assertEqual(record["DbInfo"]["FieldList"][13]["IsNumerical"], "N")
00283         self.assertEqual(record["DbInfo"]["FieldList"][13]["SingleToken"], "Y")
00284         self.assertEqual(record["DbInfo"]["FieldList"][13]["Hierarchy"], "N")
00285         self.assertEqual(record["DbInfo"]["FieldList"][13]["IsHidden"], "N")
00286         self.assertEqual(record["DbInfo"]["FieldList"][14]["Name"], "VOL")
00287         self.assertEqual(record["DbInfo"]["FieldList"][14]["FullName"], "Volume")
00288         self.assertEqual(record["DbInfo"]["FieldList"][14]["Description"], "Volume number of publication")
00289         self.assertEqual(record["DbInfo"]["FieldList"][14]["TermCount"], "12026")
00290         self.assertEqual(record["DbInfo"]["FieldList"][14]["IsDate"], "N")
00291         self.assertEqual(record["DbInfo"]["FieldList"][14]["IsNumerical"], "N")
00292         self.assertEqual(record["DbInfo"]["FieldList"][14]["SingleToken"], "Y")
00293         self.assertEqual(record["DbInfo"]["FieldList"][14]["Hierarchy"], "N")
00294         self.assertEqual(record["DbInfo"]["FieldList"][14]["IsHidden"], "N")
00295         self.assertEqual(record["DbInfo"]["FieldList"][15]["Name"], "PAGE")
00296         self.assertEqual(record["DbInfo"]["FieldList"][15]["FullName"], "Pagination")
00297         self.assertEqual(record["DbInfo"]["FieldList"][15]["Description"], "Page number(s) of publication")
00298         self.assertEqual(record["DbInfo"]["FieldList"][15]["TermCount"], "1274867")
00299         self.assertEqual(record["DbInfo"]["FieldList"][15]["IsDate"], "N")
00300         self.assertEqual(record["DbInfo"]["FieldList"][15]["IsNumerical"], "N")
00301         self.assertEqual(record["DbInfo"]["FieldList"][15]["SingleToken"], "Y")
00302         self.assertEqual(record["DbInfo"]["FieldList"][15]["Hierarchy"], "N")
00303         self.assertEqual(record["DbInfo"]["FieldList"][15]["IsHidden"], "N")
00304         self.assertEqual(record["DbInfo"]["FieldList"][16]["Name"], "PTYP")
00305         self.assertEqual(record["DbInfo"]["FieldList"][16]["FullName"], "Publication Type")
00306         self.assertEqual(record["DbInfo"]["FieldList"][16]["Description"], "Type of publication (e.g., review)")
00307         self.assertEqual(record["DbInfo"]["FieldList"][16]["TermCount"], "71")
00308         self.assertEqual(record["DbInfo"]["FieldList"][16]["IsDate"], "N")
00309         self.assertEqual(record["DbInfo"]["FieldList"][16]["IsNumerical"], "N")
00310         self.assertEqual(record["DbInfo"]["FieldList"][16]["SingleToken"], "Y")
00311         self.assertEqual(record["DbInfo"]["FieldList"][16]["Hierarchy"], "Y")
00312         self.assertEqual(record["DbInfo"]["FieldList"][16]["IsHidden"], "N")
00313         self.assertEqual(record["DbInfo"]["FieldList"][17]["Name"], "LANG")
00314         self.assertEqual(record["DbInfo"]["FieldList"][17]["FullName"], "Language")
00315         self.assertEqual(record["DbInfo"]["FieldList"][17]["Description"], "Language of publication")
00316         self.assertEqual(record["DbInfo"]["FieldList"][17]["TermCount"], "57")
00317         self.assertEqual(record["DbInfo"]["FieldList"][17]["IsDate"], "N")
00318         self.assertEqual(record["DbInfo"]["FieldList"][17]["IsNumerical"], "N")
00319         self.assertEqual(record["DbInfo"]["FieldList"][17]["SingleToken"], "Y")
00320         self.assertEqual(record["DbInfo"]["FieldList"][17]["Hierarchy"], "N")
00321         self.assertEqual(record["DbInfo"]["FieldList"][17]["IsHidden"], "N")
00322         self.assertEqual(record["DbInfo"]["FieldList"][18]["Name"], "ISS")
00323         self.assertEqual(record["DbInfo"]["FieldList"][18]["FullName"], "Issue")
00324         self.assertEqual(record["DbInfo"]["FieldList"][18]["Description"], "Issue number of publication")
00325         self.assertEqual(record["DbInfo"]["FieldList"][18]["TermCount"], "16835")
00326         self.assertEqual(record["DbInfo"]["FieldList"][18]["IsDate"], "N")
00327         self.assertEqual(record["DbInfo"]["FieldList"][18]["IsNumerical"], "N")
00328         self.assertEqual(record["DbInfo"]["FieldList"][18]["SingleToken"], "Y")
00329         self.assertEqual(record["DbInfo"]["FieldList"][18]["Hierarchy"], "N")
00330         self.assertEqual(record["DbInfo"]["FieldList"][18]["IsHidden"], "N")
00331         self.assertEqual(record["DbInfo"]["FieldList"][19]["Name"], "SUBH")
00332         self.assertEqual(record["DbInfo"]["FieldList"][19]["FullName"], "MeSH Subheading")
00333         self.assertEqual(record["DbInfo"]["FieldList"][19]["Description"], "Additional specificity for MeSH term")
00334         self.assertEqual(record["DbInfo"]["FieldList"][19]["TermCount"], "83")
00335         self.assertEqual(record["DbInfo"]["FieldList"][19]["IsDate"], "N")
00336         self.assertEqual(record["DbInfo"]["FieldList"][19]["IsNumerical"], "N")
00337         self.assertEqual(record["DbInfo"]["FieldList"][19]["SingleToken"], "Y")
00338         self.assertEqual(record["DbInfo"]["FieldList"][19]["Hierarchy"], "Y")
00339         self.assertEqual(record["DbInfo"]["FieldList"][19]["IsHidden"], "N")
00340         self.assertEqual(record["DbInfo"]["FieldList"][20]["Name"], "SI")
00341         self.assertEqual(record["DbInfo"]["FieldList"][20]["FullName"], "Secondary Source ID")
00342         self.assertEqual(record["DbInfo"]["FieldList"][20]["Description"], "Cross-reference from publication to other databases")
00343         self.assertEqual(record["DbInfo"]["FieldList"][20]["TermCount"], "3821402")
00344         self.assertEqual(record["DbInfo"]["FieldList"][20]["IsDate"], "N")
00345         self.assertEqual(record["DbInfo"]["FieldList"][20]["IsNumerical"], "N")
00346         self.assertEqual(record["DbInfo"]["FieldList"][20]["SingleToken"], "Y")
00347         self.assertEqual(record["DbInfo"]["FieldList"][20]["Hierarchy"], "N")
00348         self.assertEqual(record["DbInfo"]["FieldList"][20]["IsHidden"], "N")
00349         self.assertEqual(record["DbInfo"]["FieldList"][21]["Name"], "MHDA")
00350         self.assertEqual(record["DbInfo"]["FieldList"][21]["FullName"], "MeSH Date")
00351         self.assertEqual(record["DbInfo"]["FieldList"][21]["Description"], "Date publication was indexed with MeSH terms")
00352         self.assertEqual(record["DbInfo"]["FieldList"][21]["TermCount"], "33923")
00353         self.assertEqual(record["DbInfo"]["FieldList"][21]["IsDate"], "Y")
00354         self.assertEqual(record["DbInfo"]["FieldList"][21]["IsNumerical"], "N")
00355         self.assertEqual(record["DbInfo"]["FieldList"][21]["SingleToken"], "Y")
00356         self.assertEqual(record["DbInfo"]["FieldList"][21]["Hierarchy"], "N")
00357         self.assertEqual(record["DbInfo"]["FieldList"][21]["IsHidden"], "N")
00358         self.assertEqual(record["DbInfo"]["FieldList"][22]["Name"], "TIAB")
00359         self.assertEqual(record["DbInfo"]["FieldList"][22]["FullName"], "Title/Abstract")
00360         self.assertEqual(record["DbInfo"]["FieldList"][22]["Description"], "Free text associated with Abstract/Title")
00361         self.assertEqual(record["DbInfo"]["FieldList"][22]["TermCount"], "35092258")
00362         self.assertEqual(record["DbInfo"]["FieldList"][22]["IsDate"], "N")
00363         self.assertEqual(record["DbInfo"]["FieldList"][22]["IsNumerical"], "N")
00364         self.assertEqual(record["DbInfo"]["FieldList"][22]["SingleToken"], "N")
00365         self.assertEqual(record["DbInfo"]["FieldList"][22]["Hierarchy"], "N")
00366         self.assertEqual(record["DbInfo"]["FieldList"][22]["IsHidden"], "N")
00367         self.assertEqual(record["DbInfo"]["FieldList"][23]["Name"], "OTRM")
00368         self.assertEqual(record["DbInfo"]["FieldList"][23]["FullName"], "Other Term")
00369         self.assertEqual(record["DbInfo"]["FieldList"][23]["Description"], "Other terms associated with publication")
00370         self.assertEqual(record["DbInfo"]["FieldList"][23]["TermCount"], "333870")
00371         self.assertEqual(record["DbInfo"]["FieldList"][23]["IsDate"], "N")
00372         self.assertEqual(record["DbInfo"]["FieldList"][23]["IsNumerical"], "N")
00373         self.assertEqual(record["DbInfo"]["FieldList"][23]["SingleToken"], "N")
00374         self.assertEqual(record["DbInfo"]["FieldList"][23]["Hierarchy"], "N")
00375         self.assertEqual(record["DbInfo"]["FieldList"][23]["IsHidden"], "Y")
00376         self.assertEqual(record["DbInfo"]["FieldList"][24]["Name"], "INVR")
00377         self.assertEqual(record["DbInfo"]["FieldList"][24]["FullName"], "Investigator")
00378         self.assertEqual(record["DbInfo"]["FieldList"][24]["Description"], "Investigator")
00379         self.assertEqual(record["DbInfo"]["FieldList"][24]["TermCount"], "516245")
00380         self.assertEqual(record["DbInfo"]["FieldList"][24]["IsDate"], "N")
00381         self.assertEqual(record["DbInfo"]["FieldList"][24]["IsNumerical"], "N")
00382         self.assertEqual(record["DbInfo"]["FieldList"][24]["SingleToken"], "Y")
00383         self.assertEqual(record["DbInfo"]["FieldList"][24]["Hierarchy"], "N")
00384         self.assertEqual(record["DbInfo"]["FieldList"][24]["IsHidden"], "N")
00385         self.assertEqual(record["DbInfo"]["FieldList"][25]["Name"], "COLN")
00386         self.assertEqual(record["DbInfo"]["FieldList"][25]["FullName"], "Corporate Author")
00387         self.assertEqual(record["DbInfo"]["FieldList"][25]["Description"], "Corporate Author of publication")
00388         self.assertEqual(record["DbInfo"]["FieldList"][25]["TermCount"], "132665")
00389         self.assertEqual(record["DbInfo"]["FieldList"][25]["IsDate"], "N")
00390         self.assertEqual(record["DbInfo"]["FieldList"][25]["IsNumerical"], "N")
00391         self.assertEqual(record["DbInfo"]["FieldList"][25]["SingleToken"], "N")
00392         self.assertEqual(record["DbInfo"]["FieldList"][25]["Hierarchy"], "N")
00393         self.assertEqual(record["DbInfo"]["FieldList"][25]["IsHidden"], "N")
00394         self.assertEqual(record["DbInfo"]["FieldList"][26]["Name"], "CNTY")
00395         self.assertEqual(record["DbInfo"]["FieldList"][26]["FullName"], "Place of Publication")
00396         self.assertEqual(record["DbInfo"]["FieldList"][26]["Description"], "Country of publication")
00397         self.assertEqual(record["DbInfo"]["FieldList"][26]["TermCount"], "279")
00398         self.assertEqual(record["DbInfo"]["FieldList"][26]["IsDate"], "N")
00399         self.assertEqual(record["DbInfo"]["FieldList"][26]["IsNumerical"], "N")
00400         self.assertEqual(record["DbInfo"]["FieldList"][26]["SingleToken"], "N")
00401         self.assertEqual(record["DbInfo"]["FieldList"][26]["Hierarchy"], "N")
00402         self.assertEqual(record["DbInfo"]["FieldList"][26]["IsHidden"], "Y")
00403         self.assertEqual(record["DbInfo"]["FieldList"][27]["Name"], "PAPX")
00404         self.assertEqual(record["DbInfo"]["FieldList"][27]["FullName"], "Pharmacological Action")
00405         self.assertEqual(record["DbInfo"]["FieldList"][27]["Description"], "MeSH pharmacological action pre-explosions")
00406         self.assertEqual(record["DbInfo"]["FieldList"][27]["TermCount"], "420")
00407         self.assertEqual(record["DbInfo"]["FieldList"][27]["IsDate"], "N")
00408         self.assertEqual(record["DbInfo"]["FieldList"][27]["IsNumerical"], "N")
00409         self.assertEqual(record["DbInfo"]["FieldList"][27]["SingleToken"], "Y")
00410         self.assertEqual(record["DbInfo"]["FieldList"][27]["Hierarchy"], "N")
00411         self.assertEqual(record["DbInfo"]["FieldList"][27]["IsHidden"], "N")
00412         self.assertEqual(record["DbInfo"]["FieldList"][28]["Name"], "GRNT")
00413         self.assertEqual(record["DbInfo"]["FieldList"][28]["FullName"], "Grant Number")
00414         self.assertEqual(record["DbInfo"]["FieldList"][28]["Description"], "NIH Grant Numbers")
00415         self.assertEqual(record["DbInfo"]["FieldList"][28]["TermCount"], "2588283")
00416         self.assertEqual(record["DbInfo"]["FieldList"][28]["IsDate"], "N")
00417         self.assertEqual(record["DbInfo"]["FieldList"][28]["IsNumerical"], "N")
00418         self.assertEqual(record["DbInfo"]["FieldList"][28]["SingleToken"], "Y")
00419         self.assertEqual(record["DbInfo"]["FieldList"][28]["Hierarchy"], "N")
00420         self.assertEqual(record["DbInfo"]["FieldList"][28]["IsHidden"], "N")
00421         self.assertEqual(record["DbInfo"]["FieldList"][29]["Name"], "MDAT")
00422         self.assertEqual(record["DbInfo"]["FieldList"][29]["FullName"], "Modification Date")
00423         self.assertEqual(record["DbInfo"]["FieldList"][29]["Description"], "Date of last modification")
00424         self.assertEqual(record["DbInfo"]["FieldList"][29]["TermCount"], "2777")
00425         self.assertEqual(record["DbInfo"]["FieldList"][29]["IsDate"], "Y")
00426         self.assertEqual(record["DbInfo"]["FieldList"][29]["IsNumerical"], "N")
00427         self.assertEqual(record["DbInfo"]["FieldList"][29]["SingleToken"], "Y")
00428         self.assertEqual(record["DbInfo"]["FieldList"][29]["Hierarchy"], "N")
00429         self.assertEqual(record["DbInfo"]["FieldList"][29]["IsHidden"], "Y")
00430         self.assertEqual(record["DbInfo"]["FieldList"][30]["Name"], "CDAT")
00431         self.assertEqual(record["DbInfo"]["FieldList"][30]["FullName"], "Completion Date")
00432         self.assertEqual(record["DbInfo"]["FieldList"][30]["Description"], "Date of completion")
00433         self.assertEqual(record["DbInfo"]["FieldList"][30]["TermCount"], "9268")
00434         self.assertEqual(record["DbInfo"]["FieldList"][30]["IsDate"], "Y")
00435         self.assertEqual(record["DbInfo"]["FieldList"][30]["IsNumerical"], "N")
00436         self.assertEqual(record["DbInfo"]["FieldList"][30]["SingleToken"], "Y")
00437         self.assertEqual(record["DbInfo"]["FieldList"][30]["Hierarchy"], "N")
00438         self.assertEqual(record["DbInfo"]["FieldList"][30]["IsHidden"], "Y")
00439         self.assertEqual(record["DbInfo"]["FieldList"][31]["Name"], "PID")
00440         self.assertEqual(record["DbInfo"]["FieldList"][31]["FullName"], "Publisher ID")
00441         self.assertEqual(record["DbInfo"]["FieldList"][31]["Description"], "Publisher ID")
00442         self.assertEqual(record["DbInfo"]["FieldList"][31]["TermCount"], "8894288")
00443         self.assertEqual(record["DbInfo"]["FieldList"][31]["IsDate"], "N")
00444         self.assertEqual(record["DbInfo"]["FieldList"][31]["IsNumerical"], "N")
00445         self.assertEqual(record["DbInfo"]["FieldList"][31]["SingleToken"], "Y")
00446         self.assertEqual(record["DbInfo"]["FieldList"][31]["Hierarchy"], "N")
00447         self.assertEqual(record["DbInfo"]["FieldList"][31]["IsHidden"], "Y")
00448         self.assertEqual(record["DbInfo"]["FieldList"][32]["Name"], "FAUT")
00449         self.assertEqual(record["DbInfo"]["FieldList"][32]["FullName"], "First Author")
00450         self.assertEqual(record["DbInfo"]["FieldList"][32]["Description"], "First Author of publication")
00451         self.assertEqual(record["DbInfo"]["FieldList"][32]["TermCount"], "6068222")
00452         self.assertEqual(record["DbInfo"]["FieldList"][32]["IsDate"], "N")
00453         self.assertEqual(record["DbInfo"]["FieldList"][32]["IsNumerical"], "N")
00454         self.assertEqual(record["DbInfo"]["FieldList"][32]["SingleToken"], "Y")
00455         self.assertEqual(record["DbInfo"]["FieldList"][32]["Hierarchy"], "N")
00456         self.assertEqual(record["DbInfo"]["FieldList"][32]["IsHidden"], "N")
00457         self.assertEqual(record["DbInfo"]["FieldList"][33]["Name"], "FULL")
00458         self.assertEqual(record["DbInfo"]["FieldList"][33]["FullName"], "Full Author Name")
00459         self.assertEqual(record["DbInfo"]["FieldList"][33]["Description"], "Full Author Name(s) of publication")
00460         self.assertEqual(record["DbInfo"]["FieldList"][33]["TermCount"], "6419103")
00461         self.assertEqual(record["DbInfo"]["FieldList"][33]["IsDate"], "N")
00462         self.assertEqual(record["DbInfo"]["FieldList"][33]["IsNumerical"], "N")
00463         self.assertEqual(record["DbInfo"]["FieldList"][33]["SingleToken"], "Y")
00464         self.assertEqual(record["DbInfo"]["FieldList"][33]["Hierarchy"], "N")
00465         self.assertEqual(record["DbInfo"]["FieldList"][33]["IsHidden"], "N")
00466         self.assertEqual(record["DbInfo"]["FieldList"][34]["Name"], "FINV")
00467         self.assertEqual(record["DbInfo"]["FieldList"][34]["FullName"], "Full Investigator Name")
00468         self.assertEqual(record["DbInfo"]["FieldList"][34]["Description"], "Full name of investigator")
00469         self.assertEqual(record["DbInfo"]["FieldList"][34]["TermCount"], "243898")
00470         self.assertEqual(record["DbInfo"]["FieldList"][34]["IsDate"], "N")
00471         self.assertEqual(record["DbInfo"]["FieldList"][34]["IsNumerical"], "N")
00472         self.assertEqual(record["DbInfo"]["FieldList"][34]["SingleToken"], "Y")
00473         self.assertEqual(record["DbInfo"]["FieldList"][34]["Hierarchy"], "N")
00474         self.assertEqual(record["DbInfo"]["FieldList"][34]["IsHidden"], "N")
00475         self.assertEqual(record["DbInfo"]["FieldList"][35]["Name"], "TT")
00476         self.assertEqual(record["DbInfo"]["FieldList"][35]["FullName"], "Transliterated Title")
00477         self.assertEqual(record["DbInfo"]["FieldList"][35]["Description"], "Words in transliterated title of publication")
00478         self.assertEqual(record["DbInfo"]["FieldList"][35]["TermCount"], "2177885")
00479         self.assertEqual(record["DbInfo"]["FieldList"][35]["IsDate"], "N")
00480         self.assertEqual(record["DbInfo"]["FieldList"][35]["IsNumerical"], "N")
00481         self.assertEqual(record["DbInfo"]["FieldList"][35]["SingleToken"], "N")
00482         self.assertEqual(record["DbInfo"]["FieldList"][35]["Hierarchy"], "N")
00483         self.assertEqual(record["DbInfo"]["FieldList"][35]["IsHidden"], "N")
00484         self.assertEqual(record["DbInfo"]["FieldList"][36]["Name"], "LAUT")
00485         self.assertEqual(record["DbInfo"]["FieldList"][36]["FullName"], "Last Author")
00486         self.assertEqual(record["DbInfo"]["FieldList"][36]["Description"], "Last Author of publication")
00487         self.assertEqual(record["DbInfo"]["FieldList"][36]["TermCount"], "5655625")
00488         self.assertEqual(record["DbInfo"]["FieldList"][36]["IsDate"], "N")
00489         self.assertEqual(record["DbInfo"]["FieldList"][36]["IsNumerical"], "N")
00490         self.assertEqual(record["DbInfo"]["FieldList"][36]["SingleToken"], "Y")
00491         self.assertEqual(record["DbInfo"]["FieldList"][36]["Hierarchy"], "N")
00492         self.assertEqual(record["DbInfo"]["FieldList"][36]["IsHidden"], "N")
00493         self.assertEqual(record["DbInfo"]["FieldList"][37]["Name"], "PPDT")
00494         self.assertEqual(record["DbInfo"]["FieldList"][37]["FullName"], "Print Publication Date")
00495         self.assertEqual(record["DbInfo"]["FieldList"][37]["Description"], "Date of print publication")
00496         self.assertEqual(record["DbInfo"]["FieldList"][37]["TermCount"], "35164")
00497         self.assertEqual(record["DbInfo"]["FieldList"][37]["IsDate"], "Y")
00498         self.assertEqual(record["DbInfo"]["FieldList"][37]["IsNumerical"], "N")
00499         self.assertEqual(record["DbInfo"]["FieldList"][37]["SingleToken"], "Y")
00500         self.assertEqual(record["DbInfo"]["FieldList"][37]["Hierarchy"], "N")
00501         self.assertEqual(record["DbInfo"]["FieldList"][37]["IsHidden"], "Y")
00502         self.assertEqual(record["DbInfo"]["FieldList"][38]["Name"], "EPDT")
00503         self.assertEqual(record["DbInfo"]["FieldList"][38]["FullName"], "Electronic Publication Date")
00504         self.assertEqual(record["DbInfo"]["FieldList"][38]["Description"], "Date of Electronic publication")
00505         self.assertEqual(record["DbInfo"]["FieldList"][38]["TermCount"], "4282")
00506         self.assertEqual(record["DbInfo"]["FieldList"][38]["IsDate"], "Y")
00507         self.assertEqual(record["DbInfo"]["FieldList"][38]["IsNumerical"], "N")
00508         self.assertEqual(record["DbInfo"]["FieldList"][38]["SingleToken"], "Y")
00509         self.assertEqual(record["DbInfo"]["FieldList"][38]["Hierarchy"], "N")
00510         self.assertEqual(record["DbInfo"]["FieldList"][38]["IsHidden"], "Y")
00511         self.assertEqual(record["DbInfo"]["FieldList"][39]["Name"], "LID")
00512         self.assertEqual(record["DbInfo"]["FieldList"][39]["FullName"], "Location ID")
00513         self.assertEqual(record["DbInfo"]["FieldList"][39]["Description"], "ELocation ID")
00514         self.assertEqual(record["DbInfo"]["FieldList"][39]["TermCount"], "56212")
00515         self.assertEqual(record["DbInfo"]["FieldList"][39]["IsDate"], "N")
00516         self.assertEqual(record["DbInfo"]["FieldList"][39]["IsNumerical"], "N")
00517         self.assertEqual(record["DbInfo"]["FieldList"][39]["SingleToken"], "Y")
00518         self.assertEqual(record["DbInfo"]["FieldList"][39]["Hierarchy"], "N")
00519         self.assertEqual(record["DbInfo"]["FieldList"][39]["IsHidden"], "N")
00520         self.assertEqual(record["DbInfo"]["FieldList"][40]["Name"], "CRDT")
00521         self.assertEqual(record["DbInfo"]["FieldList"][40]["FullName"], "Create Date")
00522         self.assertEqual(record["DbInfo"]["FieldList"][40]["Description"], "Date publication first accessible through Entrez")
00523         self.assertEqual(record["DbInfo"]["FieldList"][40]["TermCount"], "27563")
00524         self.assertEqual(record["DbInfo"]["FieldList"][40]["IsDate"], "Y")
00525         self.assertEqual(record["DbInfo"]["FieldList"][40]["IsNumerical"], "N")
00526         self.assertEqual(record["DbInfo"]["FieldList"][40]["SingleToken"], "Y")
00527         self.assertEqual(record["DbInfo"]["FieldList"][40]["Hierarchy"], "N")
00528         self.assertEqual(record["DbInfo"]["FieldList"][40]["IsHidden"], "N")
00529         self.assertEqual(record["DbInfo"]["FieldList"][41]["Name"], "BOOK")
00530         self.assertEqual(record["DbInfo"]["FieldList"][41]["FullName"], "Book")
00531         self.assertEqual(record["DbInfo"]["FieldList"][41]["Description"], "ID of the book that contains the document")
00532         self.assertEqual(record["DbInfo"]["FieldList"][41]["TermCount"], "342")
00533         self.assertEqual(record["DbInfo"]["FieldList"][41]["IsDate"], "N")
00534         self.assertEqual(record["DbInfo"]["FieldList"][41]["IsNumerical"], "N")
00535         self.assertEqual(record["DbInfo"]["FieldList"][41]["SingleToken"], "Y")
00536         self.assertEqual(record["DbInfo"]["FieldList"][41]["Hierarchy"], "N")
00537         self.assertEqual(record["DbInfo"]["FieldList"][41]["IsHidden"], "N")
00538         self.assertEqual(record["DbInfo"]["FieldList"][42]["Name"], "ED")
00539         self.assertEqual(record["DbInfo"]["FieldList"][42]["FullName"], "Editor")
00540         self.assertEqual(record["DbInfo"]["FieldList"][42]["Description"], "Section's Editor")
00541         self.assertEqual(record["DbInfo"]["FieldList"][42]["TermCount"], "335")
00542         self.assertEqual(record["DbInfo"]["FieldList"][42]["IsDate"], "N")
00543         self.assertEqual(record["DbInfo"]["FieldList"][42]["IsNumerical"], "N")
00544         self.assertEqual(record["DbInfo"]["FieldList"][42]["SingleToken"], "Y")
00545         self.assertEqual(record["DbInfo"]["FieldList"][42]["Hierarchy"], "N")
00546         self.assertEqual(record["DbInfo"]["FieldList"][42]["IsHidden"], "N")
00547         self.assertEqual(record["DbInfo"]["FieldList"][43]["Name"], "ISBN")
00548         self.assertEqual(record["DbInfo"]["FieldList"][43]["FullName"], "ISBN")
00549         self.assertEqual(record["DbInfo"]["FieldList"][43]["Description"], "ISBN")
00550         self.assertEqual(record["DbInfo"]["FieldList"][43]["TermCount"], "189")
00551         self.assertEqual(record["DbInfo"]["FieldList"][43]["IsDate"], "N")
00552         self.assertEqual(record["DbInfo"]["FieldList"][43]["IsNumerical"], "N")
00553         self.assertEqual(record["DbInfo"]["FieldList"][43]["SingleToken"], "Y")
00554         self.assertEqual(record["DbInfo"]["FieldList"][43]["Hierarchy"], "N")
00555         self.assertEqual(record["DbInfo"]["FieldList"][43]["IsHidden"], "N")
00556         self.assertEqual(record["DbInfo"]["FieldList"][44]["Name"], "PUBN")
00557         self.assertEqual(record["DbInfo"]["FieldList"][44]["FullName"], "Publisher")
00558         self.assertEqual(record["DbInfo"]["FieldList"][44]["Description"], "Publisher's name")
00559         self.assertEqual(record["DbInfo"]["FieldList"][44]["TermCount"], "161")
00560         self.assertEqual(record["DbInfo"]["FieldList"][44]["IsDate"], "N")
00561         self.assertEqual(record["DbInfo"]["FieldList"][44]["IsNumerical"], "N")
00562         self.assertEqual(record["DbInfo"]["FieldList"][44]["SingleToken"], "Y")
00563         self.assertEqual(record["DbInfo"]["FieldList"][44]["Hierarchy"], "N")
00564         self.assertEqual(record["DbInfo"]["FieldList"][44]["IsHidden"], "N")
00565         self.assertEqual(len(record["DbInfo"]["LinkList"]), 57)
00566         self.assertEqual(record["DbInfo"]["LinkList"][0]["Name"], "pubmed_biosample")
00567         self.assertEqual(record["DbInfo"]["LinkList"][0]["Menu"], "BioSample Links")
00568         self.assertEqual(record["DbInfo"]["LinkList"][0]["Description"], "BioSample links")
00569         self.assertEqual(record["DbInfo"]["LinkList"][0]["DbTo"], "biosample")
00570         self.assertEqual(record["DbInfo"]["LinkList"][1]["Name"], "pubmed_biosystems")
00571         self.assertEqual(record["DbInfo"]["LinkList"][1]["Menu"], "BioSystem Links")
00572         self.assertEqual(record["DbInfo"]["LinkList"][1]["Description"], "Pathways and biological systems (BioSystems) that cite the current articles. Citations are from the BioSystems source databases (KEGG and BioCyc).")
00573         self.assertEqual(record["DbInfo"]["LinkList"][1]["DbTo"], "biosystems")
00574         self.assertEqual(record["DbInfo"]["LinkList"][2]["Name"], "pubmed_books_refs")
00575         self.assertEqual(record["DbInfo"]["LinkList"][2]["Menu"], "Cited in Books")
00576         self.assertEqual(record["DbInfo"]["LinkList"][2]["Description"], "NCBI Bookshelf books that cite the current articles.")
00577         self.assertEqual(record["DbInfo"]["LinkList"][2]["DbTo"], "books")
00578         self.assertEqual(record["DbInfo"]["LinkList"][3]["Name"], "pubmed_cancerchromosomes")
00579         self.assertEqual(record["DbInfo"]["LinkList"][3]["Menu"], "CancerChrom Links")
00580         self.assertEqual(record["DbInfo"]["LinkList"][3]["Description"], "Cancer chromosome records that cite the current articles.")
00581         self.assertEqual(record["DbInfo"]["LinkList"][3]["DbTo"], "cancerchromosomes")
00582         self.assertEqual(record["DbInfo"]["LinkList"][4]["Name"], "pubmed_cdd")
00583         self.assertEqual(record["DbInfo"]["LinkList"][4]["Menu"], "Domain Links")
00584         self.assertEqual(record["DbInfo"]["LinkList"][4]["Description"], "Conserved Domain Database (CDD) records that cite the current articles. Citations are from the CDD source database records (PFAM, SMART).")
00585         self.assertEqual(record["DbInfo"]["LinkList"][4]["DbTo"], "cdd")
00586         self.assertEqual(record["DbInfo"]["LinkList"][5]["Name"], "pubmed_domains")
00587         self.assertEqual(record["DbInfo"]["LinkList"][5]["Menu"], "3D Domain Links")
00588         self.assertEqual(record["DbInfo"]["LinkList"][5]["Description"], "Structural domains in the NCBI Structure database that are parts of the 3D structures reported in the current articles.")
00589         self.assertEqual(record["DbInfo"]["LinkList"][5]["DbTo"], "domains")
00590         self.assertEqual(record["DbInfo"]["LinkList"][6]["Name"], "pubmed_epigenomics")
00591         self.assertEqual(record["DbInfo"]["LinkList"][6]["Menu"], "Epigenomics Links")
00592         self.assertEqual(record["DbInfo"]["LinkList"][6]["Description"], "Related Epigenomics records")
00593         self.assertEqual(record["DbInfo"]["LinkList"][6]["DbTo"], "epigenomics")
00594         self.assertEqual(record["DbInfo"]["LinkList"][7]["Name"], "pubmed_gap")
00595         self.assertEqual(record["DbInfo"]["LinkList"][7]["Menu"], "dbGaP Links")
00596         self.assertEqual(record["DbInfo"]["LinkList"][7]["Description"], "Genotypes and Phenotypes (dbGaP) studies that cite the current articles.")
00597         self.assertEqual(record["DbInfo"]["LinkList"][7]["DbTo"], "gap")
00598         self.assertEqual(record["DbInfo"]["LinkList"][8]["Name"], "pubmed_gds")
00599         self.assertEqual(record["DbInfo"]["LinkList"][8]["Menu"], "GEO DataSet Links")
00600         self.assertEqual(record["DbInfo"]["LinkList"][8]["Description"], "Gene expression and molecular abundance data reported in the current articles that are also included in the curated Gene Expression Omnibus (GEO) DataSets.")
00601         self.assertEqual(record["DbInfo"]["LinkList"][8]["DbTo"], "gds")
00602         self.assertEqual(record["DbInfo"]["LinkList"][9]["Name"], "pubmed_gene")
00603         self.assertEqual(record["DbInfo"]["LinkList"][9]["Menu"], "Gene Links")
00604         self.assertEqual(record["DbInfo"]["LinkList"][9]["Description"], "Gene records that cite the current articles. Citations in Gene are added manually by NCBI or imported from outside public resources.")
00605         self.assertEqual(record["DbInfo"]["LinkList"][9]["DbTo"], "gene")
00606         self.assertEqual(record["DbInfo"]["LinkList"][10]["Name"], "pubmed_gene_bookrecords")
00607         self.assertEqual(record["DbInfo"]["LinkList"][10]["Menu"], "Gene (from Bookshelf)")
00608         self.assertEqual(record["DbInfo"]["LinkList"][10]["Description"], "Gene records in this citation")
00609         self.assertEqual(record["DbInfo"]["LinkList"][10]["DbTo"], "gene")
00610         self.assertEqual(record["DbInfo"]["LinkList"][11]["Name"], "pubmed_gene_citedinomim")
00611         self.assertEqual(record["DbInfo"]["LinkList"][11]["Menu"], "Gene (OMIM) Links")
00612         self.assertEqual(record["DbInfo"]["LinkList"][11]["Description"], "Gene records associated with Online Mendelian Inheritance in Man (OMIM) records that cite the current articles in their reference lists.")
00613         self.assertEqual(record["DbInfo"]["LinkList"][11]["DbTo"], "gene")
00614         self.assertEqual(record["DbInfo"]["LinkList"][12]["Name"], "pubmed_gene_rif")
00615         self.assertEqual(record["DbInfo"]["LinkList"][12]["Menu"], "Gene (GeneRIF) Links")
00616         self.assertEqual(record["DbInfo"]["LinkList"][12]["Description"], "Gene records that have the current articles as Reference into Function citations (GeneRIFs). NLM staff reviewing the literature while indexing MEDLINE add GeneRIFs manually.")
00617         self.assertEqual(record["DbInfo"]["LinkList"][12]["DbTo"], "gene")
00618         self.assertEqual(record["DbInfo"]["LinkList"][13]["Name"], "pubmed_genome")
00619         self.assertEqual(record["DbInfo"]["LinkList"][13]["Menu"], "Genome Links")
00620         self.assertEqual(record["DbInfo"]["LinkList"][13]["Description"], "Genome records that include the current articles as references. These are typically the articles that report the sequencing and analysis of the genome.")
00621         self.assertEqual(record["DbInfo"]["LinkList"][13]["DbTo"], "genome")
00622         self.assertEqual(record["DbInfo"]["LinkList"][14]["Name"], "pubmed_genomeprj")
00623         self.assertEqual(record["DbInfo"]["LinkList"][14]["Menu"], "Project Links")
00624         self.assertEqual(record["DbInfo"]["LinkList"][14]["Description"], "Genome Project records that cite the current articles. References on Genome Projects include manually added citations and those included on sequences in the project.")
00625         self.assertEqual(record["DbInfo"]["LinkList"][14]["DbTo"], "genomeprj")
00626         self.assertEqual(record["DbInfo"]["LinkList"][15]["Name"], "pubmed_gensat")
00627         self.assertEqual(record["DbInfo"]["LinkList"][15]["Menu"], "GENSAT Links")
00628         self.assertEqual(record["DbInfo"]["LinkList"][15]["Description"], "Gene Expression Nervous System Atlas (GENSAT) records that cite the current articles. References on GENSAT records are provided by GENSAT investigators, and also include references on the corresponding NCBI Gene record.")
00629         self.assertEqual(record["DbInfo"]["LinkList"][15]["DbTo"], "gensat")
00630         self.assertEqual(record["DbInfo"]["LinkList"][16]["Name"], "pubmed_geo")
00631         self.assertEqual(record["DbInfo"]["LinkList"][16]["Menu"], "GEO Profile Links")
00632         self.assertEqual(record["DbInfo"]["LinkList"][16]["Description"], "Gene Expression Omnibus (GEO) Profiles of molecular abundance data. The current articles are references on the Gene record associated with the GEO profile.")
00633         self.assertEqual(record["DbInfo"]["LinkList"][16]["DbTo"], "geo")
00634         self.assertEqual(record["DbInfo"]["LinkList"][17]["Name"], "pubmed_homologene")
00635         self.assertEqual(record["DbInfo"]["LinkList"][17]["Menu"], "HomoloGene Links")
00636         self.assertEqual(record["DbInfo"]["LinkList"][17]["Description"], "HomoloGene clusters of homologous genes and sequences that cite the current articles. These are references on the Gene and sequence records in the HomoloGene entry.")
00637         self.assertEqual(record["DbInfo"]["LinkList"][17]["DbTo"], "homologene")
00638         self.assertEqual(record["DbInfo"]["LinkList"][18]["Name"], "pubmed_nuccore")
00639         self.assertEqual(record["DbInfo"]["LinkList"][18]["Menu"], "Nucleotide Links")
00640         self.assertEqual(record["DbInfo"]["LinkList"][18]["Description"], "Primary database (GenBank) nucleotide records reported in the current articles as well as Reference Sequences (RefSeqs) that include the articles as references.")
00641         self.assertEqual(record["DbInfo"]["LinkList"][18]["DbTo"], "nuccore")
00642         self.assertEqual(record["DbInfo"]["LinkList"][19]["Name"], "pubmed_nuccore_refseq")
00643         self.assertEqual(record["DbInfo"]["LinkList"][19]["Menu"], "Nucleotide (RefSeq) Links")
00644         self.assertEqual(record["DbInfo"]["LinkList"][19]["Description"], "NCBI nucleotide Reference Sequences (RefSeqs) that are cited in the current articles, included in the corresponding Gene Reference into Function, or that include the PubMed articles as references.")
00645         self.assertEqual(record["DbInfo"]["LinkList"][19]["DbTo"], "nuccore")
00646         self.assertEqual(record["DbInfo"]["LinkList"][20]["Name"], "pubmed_nuccore_weighted")
00647         self.assertEqual(record["DbInfo"]["LinkList"][20]["Menu"], "Nucleotide (Weighted) Links")
00648         self.assertEqual(record["DbInfo"]["LinkList"][20]["Description"], "Nucleotide records associated with the current articles through the Gene database. These are the related sequences on the Gene record that are added manually by NCBI.")
00649         self.assertEqual(record["DbInfo"]["LinkList"][20]["DbTo"], "nuccore")
00650         self.assertEqual(record["DbInfo"]["LinkList"][21]["Name"], "pubmed_nucest")
00651         self.assertEqual(record["DbInfo"]["LinkList"][21]["Menu"], "EST Links")
00652         self.assertEqual(record["DbInfo"]["LinkList"][21]["Description"], "Expressed Sequence Tag (EST) nucleotide sequence records reported in the current articles.")
00653         self.assertEqual(record["DbInfo"]["LinkList"][21]["DbTo"], "nucest")
00654         self.assertEqual(record["DbInfo"]["LinkList"][22]["Name"], "pubmed_nucgss")
00655         self.assertEqual(record["DbInfo"]["LinkList"][22]["Menu"], "GSS Links")
00656         self.assertEqual(record["DbInfo"]["LinkList"][22]["Description"], "Genome Survey Sequence (GSS) nucleotide records reported in the current articles.")
00657         self.assertEqual(record["DbInfo"]["LinkList"][22]["DbTo"], "nucgss")
00658         self.assertEqual(record["DbInfo"]["LinkList"][23]["Name"], "pubmed_omia")
00659         self.assertEqual(record["DbInfo"]["LinkList"][23]["Menu"], "OMIA Links")
00660         self.assertEqual(record["DbInfo"]["LinkList"][23]["Description"], "Online Mendelian Inheritance in Animals (OMIA) records that cite the current articles.")
00661         self.assertEqual(record["DbInfo"]["LinkList"][23]["DbTo"], "omia")
00662         self.assertEqual(record["DbInfo"]["LinkList"][24]["Name"], "pubmed_omim_bookrecords")
00663         self.assertEqual(record["DbInfo"]["LinkList"][24]["Menu"], "OMIM (from Bookshelf)")
00664         self.assertEqual(record["DbInfo"]["LinkList"][24]["Description"], "OMIM records in this citation")
00665         self.assertEqual(record["DbInfo"]["LinkList"][24]["DbTo"], "omim")
00666         self.assertEqual(record["DbInfo"]["LinkList"][25]["Name"], "pubmed_omim_calculated")
00667         self.assertEqual(record["DbInfo"]["LinkList"][25]["Menu"], "OMIM (calculated) Links")
00668         self.assertEqual(record["DbInfo"]["LinkList"][25]["Description"], "Online Mendelian Inheritance in Man (OMIM) records that include the current articles as references in the light bulb links within or in the citations at the end of the OMIM record. The references available through the light bulb link are collected using the PubMed related articles algorithm to identify records with similar terminology to the OMIM record.")
00669         self.assertEqual(record["DbInfo"]["LinkList"][25]["DbTo"], "omim")
00670         self.assertEqual(record["DbInfo"]["LinkList"][26]["Name"], "pubmed_omim_cited")
00671         self.assertEqual(record["DbInfo"]["LinkList"][26]["Menu"], "OMIM (cited) Links")
00672         self.assertEqual(record["DbInfo"]["LinkList"][26]["Description"], "Online Mendelian Inheritance in Man (OMIM) records that include the current articles as reference cited at the end of the OMIM record.")
00673         self.assertEqual(record["DbInfo"]["LinkList"][26]["DbTo"], "omim")
00674         self.assertEqual(record["DbInfo"]["LinkList"][27]["Name"], "pubmed_pcassay")
00675         self.assertEqual(record["DbInfo"]["LinkList"][27]["Menu"], "BioAssay Links")
00676         self.assertEqual(record["DbInfo"]["LinkList"][27]["Description"], "PubChem BioAssay experiments on the biological activities of small molecules that cite the current articles. The depositors of BioAssay data provide these references.")
00677         self.assertEqual(record["DbInfo"]["LinkList"][27]["DbTo"], "pcassay")
00678         self.assertEqual(record["DbInfo"]["LinkList"][28]["Name"], "pubmed_pccompound")
00679         self.assertEqual(record["DbInfo"]["LinkList"][28]["Menu"], "Compound Links")
00680         self.assertEqual(record["DbInfo"]["LinkList"][28]["Description"], "PubChem chemical compound records that cite the current articles. These references are taken from those provided on submitted PubChem chemical substance records. Multiple substance records may contribute to the PubChem compound record.")
00681         self.assertEqual(record["DbInfo"]["LinkList"][28]["DbTo"], "pccompound")
00682         self.assertEqual(record["DbInfo"]["LinkList"][29]["Name"], "pubmed_pccompound_mesh")
00683         self.assertEqual(record["DbInfo"]["LinkList"][29]["Menu"], "Compound (MeSH Keyword)")
00684         self.assertEqual(record["DbInfo"]["LinkList"][29]["Description"], "PubChem chemical compound records that are classified under the same Medical Subject Headings (MeSH) controlled vocabulary as the current articles.")
00685         self.assertEqual(record["DbInfo"]["LinkList"][29]["DbTo"], "pccompound")
00686         self.assertEqual(record["DbInfo"]["LinkList"][30]["Name"], "pubmed_pccompound_publisher")
00687         self.assertEqual(record["DbInfo"]["LinkList"][30]["Menu"], "Compound (Publisher) Links")
00688         self.assertEqual(record["DbInfo"]["LinkList"][30]["Description"], "Link to publisher deposited structures in the PubChem Compound database.")
00689         self.assertEqual(record["DbInfo"]["LinkList"][30]["DbTo"], "pccompound")
00690         self.assertEqual(record["DbInfo"]["LinkList"][31]["Name"], "pubmed_pcsubstance")
00691         self.assertEqual(record["DbInfo"]["LinkList"][31]["Menu"], "Substance Links")
00692         self.assertEqual(record["DbInfo"]["LinkList"][31]["Description"], "PubChem chemical substance records that cite the current articles. These references are taken from those provided on submitted PubChem chemical substance records.")
00693         self.assertEqual(record["DbInfo"]["LinkList"][31]["DbTo"], "pcsubstance")
00694         self.assertEqual(record["DbInfo"]["LinkList"][32]["Name"], "pubmed_pcsubstance_bookrecords")
00695         self.assertEqual(record["DbInfo"]["LinkList"][32]["Menu"], "PubChem Substance (from Bookshelf)")
00696         self.assertEqual(record["DbInfo"]["LinkList"][32]["Description"], "Structures in the PubChem Substance database in this citation")
00697         self.assertEqual(record["DbInfo"]["LinkList"][32]["DbTo"], "pcsubstance")
00698         self.assertEqual(record["DbInfo"]["LinkList"][33]["Name"], "pubmed_pcsubstance_mesh")
00699         self.assertEqual(record["DbInfo"]["LinkList"][33]["Menu"], "Substance (MeSH Keyword)")
00700         self.assertEqual(record["DbInfo"]["LinkList"][33]["Description"], "PubChem chemical substance (submitted) records that are classified under the same Medical Subject Headings (MeSH) controlled vocabulary as the current articles.")
00701         self.assertEqual(record["DbInfo"]["LinkList"][33]["DbTo"], "pcsubstance")
00702         self.assertEqual(record["DbInfo"]["LinkList"][34]["Name"], "pubmed_pcsubstance_publisher")
00703         self.assertEqual(record["DbInfo"]["LinkList"][34]["Menu"], "Substance (Publisher) Links")
00704         self.assertEqual(record["DbInfo"]["LinkList"][34]["Description"], "Publisher deposited structures in the PubChem Compound database that are reported in the current articles.")
00705         self.assertEqual(record["DbInfo"]["LinkList"][34]["DbTo"], "pcsubstance")
00706         self.assertEqual(record["DbInfo"]["LinkList"][35]["Name"], "pubmed_pepdome")
00707         self.assertEqual(record["DbInfo"]["LinkList"][35]["Menu"], "Peptidome Links")
00708         self.assertEqual(record["DbInfo"]["LinkList"][35]["Description"], "Protein mass spectrometry and other proteomics data from the Peptidome database reported in the current articles.")
00709         self.assertEqual(record["DbInfo"]["LinkList"][35]["DbTo"], "pepdome")
00710         self.assertEqual(record["DbInfo"]["LinkList"][36]["Name"], "pubmed_pmc")
00711         self.assertEqual(record["DbInfo"]["LinkList"][36]["Menu"], "PMC Links")
00712         self.assertEqual(record["DbInfo"]["LinkList"][36]["Description"], "Free full-text versions of the current articles in the PubMed Central database.")
00713         self.assertEqual(record["DbInfo"]["LinkList"][36]["DbTo"], "pmc")
00714         self.assertEqual(record["DbInfo"]["LinkList"][37]["Name"], "pubmed_pmc_bookrecords")
00715         self.assertEqual(record["DbInfo"]["LinkList"][37]["Menu"], "References in PMC for this Bookshelf citation")
00716         self.assertEqual(record["DbInfo"]["LinkList"][37]["Description"], "Full text of articles in PubMed Central cited in this record")
00717         self.assertEqual(record["DbInfo"]["LinkList"][37]["DbTo"], "pmc")
00718         self.assertEqual(record["DbInfo"]["LinkList"][38]["Name"], "pubmed_pmc_embargo")
00719         self.assertEqual(record["DbInfo"]["LinkList"][38]["Menu"], "")
00720         self.assertEqual(record["DbInfo"]["LinkList"][38]["Description"], "Embargoed PMC article associated with PubMed")
00721         self.assertEqual(record["DbInfo"]["LinkList"][38]["DbTo"], "pmc")
00722         self.assertEqual(record["DbInfo"]["LinkList"][39]["Name"], "pubmed_pmc_local")
00723         self.assertEqual(record["DbInfo"]["LinkList"][39]["Menu"], "")
00724         self.assertEqual(record["DbInfo"]["LinkList"][39]["Description"], "Free full text articles in PMC")
00725         self.assertEqual(record["DbInfo"]["LinkList"][39]["DbTo"], "pmc")
00726         self.assertEqual(record["DbInfo"]["LinkList"][40]["Name"], "pubmed_pmc_refs")
00727         self.assertEqual(record["DbInfo"]["LinkList"][40]["Menu"], "Cited in PMC")
00728         self.assertEqual(record["DbInfo"]["LinkList"][40]["Description"], "Full-text articles in the PubMed Central Database that cite the current articles.")
00729         self.assertEqual(record["DbInfo"]["LinkList"][40]["DbTo"], "pmc")
00730         self.assertEqual(record["DbInfo"]["LinkList"][41]["Name"], "pubmed_popset")
00731         self.assertEqual(record["DbInfo"]["LinkList"][41]["Menu"], "PopSet Links")
00732         self.assertEqual(record["DbInfo"]["LinkList"][41]["Description"], "Sets of sequences from population and evolutionary genetic studies in the PopSet database reported in the current articles.")
00733         self.assertEqual(record["DbInfo"]["LinkList"][41]["DbTo"], "popset")
00734         self.assertEqual(record["DbInfo"]["LinkList"][42]["Name"], "pubmed_probe")
00735         self.assertEqual(record["DbInfo"]["LinkList"][42]["Menu"], "Probe Links")
00736         self.assertEqual(record["DbInfo"]["LinkList"][42]["Description"], "Molecular reagents in the Probe database that cite the current articles. References in Probe are provided by submitters of the data.")
00737         self.assertEqual(record["DbInfo"]["LinkList"][42]["DbTo"], "probe")
00738         self.assertEqual(record["DbInfo"]["LinkList"][43]["Name"], "pubmed_protein")
00739         self.assertEqual(record["DbInfo"]["LinkList"][43]["Menu"], "Protein Links")
00740         self.assertEqual(record["DbInfo"]["LinkList"][43]["Description"], "Protein translation features of primary database (GenBank) nucleotide records reported in the current articles as well as Reference Sequences (RefSeqs) that include the articles as references.")
00741         self.assertEqual(record["DbInfo"]["LinkList"][43]["DbTo"], "protein")
00742         self.assertEqual(record["DbInfo"]["LinkList"][44]["Name"], "pubmed_protein_refseq")
00743         self.assertEqual(record["DbInfo"]["LinkList"][44]["Menu"], "Protein (RefSeq) Links")
00744         self.assertEqual(record["DbInfo"]["LinkList"][44]["Description"], "NCBI protein Reference Sequences (RefSeqs) that are cited in the current articles, included in the corresponding Gene Reference into Function, or that include the PubMed articles as references.")
00745         self.assertEqual(record["DbInfo"]["LinkList"][44]["DbTo"], "protein")
00746         self.assertEqual(record["DbInfo"]["LinkList"][45]["Name"], "pubmed_protein_weighted")
00747         self.assertEqual(record["DbInfo"]["LinkList"][45]["Menu"], "Protein (Weighted) Links")
00748         self.assertEqual(record["DbInfo"]["LinkList"][45]["Description"], "Protein records associated with the current articles through related Gene database records. These are the related sequences on the Gene record that are added manually by NCBI.")
00749         self.assertEqual(record["DbInfo"]["LinkList"][45]["DbTo"], "protein")
00750         self.assertEqual(record["DbInfo"]["LinkList"][46]["Name"], "pubmed_proteinclusters")
00751         self.assertEqual(record["DbInfo"]["LinkList"][46]["Menu"], "Protein Cluster Links")
00752         self.assertEqual(record["DbInfo"]["LinkList"][46]["Description"], "Clusters of related proteins from the Protein Clusters database that cite the current articles. Sources of references in Protein Clusters include the associated Gene and Conserved Domain records as well as NCBI added citations.")
00753         self.assertEqual(record["DbInfo"]["LinkList"][46]["DbTo"], "proteinclusters")
00754         self.assertEqual(record["DbInfo"]["LinkList"][47]["Name"], "pubmed_pubmed")
00755         self.assertEqual(record["DbInfo"]["LinkList"][47]["Menu"], "Related Citations")
00756         self.assertEqual(record["DbInfo"]["LinkList"][47]["Description"], u"Calculated set of PubMed citations closely related to the selected article(s) retrieved using a word weight algorithm. Related articles are displayed in ranked order from most to least relevant, with the \u201clinked from\u201d citation displayed first.")
00757         self.assertEqual(record["DbInfo"]["LinkList"][47]["DbTo"], "pubmed")
00758         self.assertEqual(record["DbInfo"]["LinkList"][48]["Name"], "pubmed_pubmed_bookrecords")
00759         self.assertEqual(record["DbInfo"]["LinkList"][48]["Menu"], "References for this Bookshelf citation")
00760         self.assertEqual(record["DbInfo"]["LinkList"][48]["Description"], "PubMed abstracts for articles cited in this record")
00761         self.assertEqual(record["DbInfo"]["LinkList"][48]["DbTo"], "pubmed")
00762         self.assertEqual(record["DbInfo"]["LinkList"][49]["Name"], "pubmed_pubmed_refs")
00763         self.assertEqual(record["DbInfo"]["LinkList"][49]["Menu"], "References for PMC Articles")
00764         self.assertEqual(record["DbInfo"]["LinkList"][49]["Description"], "Citation referenced in PubMed article. Only valid for PubMed citations that are also in PMC.")
00765         self.assertEqual(record["DbInfo"]["LinkList"][49]["DbTo"], "pubmed")
00766         self.assertEqual(record["DbInfo"]["LinkList"][50]["Name"], "pubmed_snp")
00767         self.assertEqual(record["DbInfo"]["LinkList"][50]["Menu"], "SNP Links")
00768         self.assertEqual(record["DbInfo"]["LinkList"][50]["Description"], "Nucleotide polymorphism records from dbSNP that have current articles as submitter-provided references.")
00769         self.assertEqual(record["DbInfo"]["LinkList"][50]["DbTo"], "snp")
00770         self.assertEqual(record["DbInfo"]["LinkList"][51]["Name"], "pubmed_snp_cited")
00771         self.assertEqual(record["DbInfo"]["LinkList"][51]["Menu"], "SNP (Cited)")
00772         self.assertEqual(record["DbInfo"]["LinkList"][51]["Description"], "Nucleotide polymorphism records from dbSNP that have NCBI dbSNP identifiers reported in the PubMed abstract of the current articles.")
00773         self.assertEqual(record["DbInfo"]["LinkList"][51]["DbTo"], "snp")
00774         self.assertEqual(record["DbInfo"]["LinkList"][52]["Name"], "pubmed_sra")
00775         self.assertEqual(record["DbInfo"]["LinkList"][52]["Menu"], "SRA Links")
00776         self.assertEqual(record["DbInfo"]["LinkList"][52]["Description"], "Massively-parallel sequencing project data in the Short Read Archive (SRA) that are reported in the current articles.")
00777         self.assertEqual(record["DbInfo"]["LinkList"][52]["DbTo"], "sra")
00778         self.assertEqual(record["DbInfo"]["LinkList"][53]["Name"], "pubmed_structure")
00779         self.assertEqual(record["DbInfo"]["LinkList"][53]["Menu"], "Structure Links")
00780         self.assertEqual(record["DbInfo"]["LinkList"][53]["Description"], "Three-dimensional structure records in the NCBI Structure database for data reported in the current articles.")
00781         self.assertEqual(record["DbInfo"]["LinkList"][53]["DbTo"], "structure")
00782         self.assertEqual(record["DbInfo"]["LinkList"][54]["Name"], "pubmed_taxonomy_entrez")
00783         self.assertEqual(record["DbInfo"]["LinkList"][54]["Menu"], "Taxonomy via GenBank")
00784         self.assertEqual(record["DbInfo"]["LinkList"][54]["Description"], "Taxonomy records associated with the current articles through taxonomic information on related molecular database records (Nucleotide, Protein, Gene, SNP, Structure).")
00785         self.assertEqual(record["DbInfo"]["LinkList"][54]["DbTo"], "taxonomy")
00786         self.assertEqual(record["DbInfo"]["LinkList"][55]["Name"], "pubmed_unigene")
00787         self.assertEqual(record["DbInfo"]["LinkList"][55]["Menu"], "UniGene Links")
00788         self.assertEqual(record["DbInfo"]["LinkList"][55]["Description"], "UniGene clusters of expressed sequences that are associated with the current articles through references on the clustered sequence records and related Gene records.")
00789         self.assertEqual(record["DbInfo"]["LinkList"][55]["DbTo"], "unigene")
00790         self.assertEqual(record["DbInfo"]["LinkList"][56]["Name"], "pubmed_unists")
00791         self.assertEqual(record["DbInfo"]["LinkList"][56]["Menu"], "UniSTS Links")
00792         self.assertEqual(record["DbInfo"]["LinkList"][56]["Description"], "Genetic, physical, and sequence mapping reagents in the UniSTS database associated with the current articles through references on sequence tagged site (STS) submissions as well as automated searching of PubMed abstracts and full-text PubMed Central articles for marker names.")
00793         self.assertEqual(record["DbInfo"]["LinkList"][56]["DbTo"], "unists")
00794 
00795     def test_corrupted(self):
00796         '''Test if corrupted XML is handled correctly
00797         '''
00798         # To create the XML file, use
00799         # >>> Bio.Entrez.einfo()
00800         # and manually delete the last couple of lines
00801         from Bio.Entrez import Parser
00802         handle = open('Entrez/einfo4.xml', "rb")
00803         self.assertRaises(Parser.CorruptedXMLError, Entrez.read, handle)
00804         handle.close()
00805 
00806 class ESearchTest(unittest.TestCase):
00807     '''Tests for parsing XML output returned by ESearch
00808     '''
00809     def test_pubmed1(self):
00810         '''Test parsing XML returned by ESearch from PubMed (first test)
00811         '''
00812         # To create the XML file, use
00813         # >>> Bio.Entrez.esearch(db="pubmed", term="biopython")
00814         handle = open('Entrez/esearch1.xml', "rb")
00815         record = Entrez.read(handle)
00816         handle.close()
00817         self.assertEqual(record['Count'], '5')
00818         self.assertEqual(record['RetMax'], '5')
00819         self.assertEqual(record['RetStart'], '0')
00820         self.assertEqual(len(record['IdList']), 5)
00821         self.assertEqual(record['IdList'][0], '16403221')
00822         self.assertEqual(record['IdList'][1], '16377612')
00823         self.assertEqual(record['IdList'][2], '14871861')
00824         self.assertEqual(record['IdList'][3], '14630660')
00825         self.assertEqual(record['IdList'][4], '12230038')
00826         self.assertEqual(len(record['TranslationSet']), 0)
00827         self.assertEqual(len(record['TranslationStack']), 2)
00828         self.assertEqual(record['TranslationStack'][0]['Term'], 'biopython[All Fields]')
00829         self.assertEqual(record['TranslationStack'][0]['Field'], 'All Fields')
00830         self.assertEqual(record['TranslationStack'][0]['Count'], '5')
00831         self.assertEqual(record['TranslationStack'][0]['Explode'], 'Y')
00832         self.assertEqual(record['TranslationStack'][1], 'GROUP')
00833         self.assertEqual(record['QueryTranslation'], 'biopython[All Fields]')
00834 
00835     def test_pubmed2(self):
00836         '''Test parsing XML returned by ESearch from PubMed (second test)
00837         '''
00838         # Search in PubMed for the term cancer for the entrez date from
00839         # the last 60 days and retrieve the first 100 IDs and translations
00840         # using the history parameter. 
00841         # To create the XML file, use
00842         # >>> Bio.Entrez.esearch(db="pubmed", term="cancer", reldate=60,
00843         #                        datetype="edat", retmax=100, usehistory="y")
00844         handle = open('Entrez/esearch2.xml', "rb")
00845         record = Entrez.read(handle)
00846         handle.close()
00847         self.assertEqual(record['Count'], "10238")
00848         self.assertEqual(record['RetMax'], "100")
00849         self.assertEqual(record['RetStart'], "0")
00850         self.assertEqual(record['QueryKey'], '12')
00851         self.assertEqual(record['WebEnv'], '0rYFb69LfbTFXfG7-0HPo2BU-ZFWF1s_51WtYR5e0fAzThQCR0WIW12inPQRRIj1xUzSfGgG9ovT9-@263F6CC86FF8F760_0173SID')
00852         self.assertEqual(len(record['IdList']), 100)
00853         self.assertEqual(record['IdList'][0], '18411453')
00854         self.assertEqual(record['IdList'][1], '18411431')
00855         self.assertEqual(record['IdList'][2], '18411430')
00856         self.assertEqual(record['IdList'][3], '18411429')
00857         self.assertEqual(record['IdList'][4], '18411428')
00858         self.assertEqual(record['IdList'][5], '18411402')
00859         self.assertEqual(record['IdList'][6], '18411381')
00860         self.assertEqual(record['IdList'][7], '18411373')
00861         self.assertEqual(record['IdList'][8], '18411372')
00862         self.assertEqual(record['IdList'][9], '18411371')
00863         self.assertEqual(record['IdList'][10], '18411370')
00864         self.assertEqual(record['IdList'][11], '18411367')
00865         self.assertEqual(record['IdList'][12], '18411306')
00866         self.assertEqual(record['IdList'][13], '18411292')
00867         self.assertEqual(record['IdList'][14], '18411277')
00868         self.assertEqual(record['IdList'][15], '18411260')
00869         self.assertEqual(record['IdList'][16], '18411234')
00870         self.assertEqual(record['IdList'][17], '18411200')
00871         self.assertEqual(record['IdList'][18], '18411199')
00872         self.assertEqual(record['IdList'][19], '18411198')
00873         self.assertEqual(record['IdList'][20], '18411197')
00874         self.assertEqual(record['IdList'][21], '18411195')
00875         self.assertEqual(record['IdList'][22], '18411194')
00876         self.assertEqual(record['IdList'][23], '18411193')
00877         self.assertEqual(record['IdList'][24], '18411192')
00878         self.assertEqual(record['IdList'][25], '18411191')
00879         self.assertEqual(record['IdList'][26], '18411052')
00880         self.assertEqual(record['IdList'][27], '18411048')
00881         self.assertEqual(record['IdList'][28], '18411046')
00882         self.assertEqual(record['IdList'][29], '18411019')
00883         self.assertEqual(record['IdList'][30], '18411018')
00884         self.assertEqual(record['IdList'][31], '18411017')
00885         self.assertEqual(record['IdList'][32], '18411015')
00886         self.assertEqual(record['IdList'][33], '18411014')
00887         self.assertEqual(record['IdList'][34], '18411011')
00888         self.assertEqual(record['IdList'][35], '18411010')
00889         self.assertEqual(record['IdList'][36], '18411005')
00890         self.assertEqual(record['IdList'][37], '18411003')
00891         self.assertEqual(record['IdList'][38], '18411001')
00892         self.assertEqual(record['IdList'][39], '18411000')
00893         self.assertEqual(record['IdList'][40], '18410999')
00894         self.assertEqual(record['IdList'][41], '18410998')
00895         self.assertEqual(record['IdList'][42], '18410997')
00896         self.assertEqual(record['IdList'][43], '18410995')
00897         self.assertEqual(record['IdList'][44], '18410977')
00898         self.assertEqual(record['IdList'][45], '18410975')
00899         self.assertEqual(record['IdList'][46], '18410966')
00900         self.assertEqual(record['IdList'][47], '18410954')
00901         self.assertEqual(record['IdList'][48], '18410953')
00902         self.assertEqual(record['IdList'][49], '18410934')
00903         self.assertEqual(record['IdList'][50], '18410925')
00904         self.assertEqual(record['IdList'][51], '18410903')
00905         self.assertEqual(record['IdList'][52], '18410826')
00906         self.assertEqual(record['IdList'][53], '18410739')
00907         self.assertEqual(record['IdList'][54], '18410720')
00908         self.assertEqual(record['IdList'][55], '18410716')
00909         self.assertEqual(record['IdList'][56], '18410709')
00910         self.assertEqual(record['IdList'][57], '18410705')
00911         self.assertEqual(record['IdList'][58], '18410692')
00912         self.assertEqual(record['IdList'][59], '18410690')
00913         self.assertEqual(record['IdList'][60], '18410634')
00914         self.assertEqual(record['IdList'][61], '18410618')
00915         self.assertEqual(record['IdList'][62], '18410610')
00916         self.assertEqual(record['IdList'][63], '18410593')
00917         self.assertEqual(record['IdList'][64], '18410587')
00918         self.assertEqual(record['IdList'][65], '18410567')
00919         self.assertEqual(record['IdList'][66], '18410539')
00920         self.assertEqual(record['IdList'][67], '18410530')
00921         self.assertEqual(record['IdList'][68], '18410528')
00922         self.assertEqual(record['IdList'][69], '18410461')
00923         self.assertEqual(record['IdList'][70], '18410455')
00924         self.assertEqual(record['IdList'][71], '18410444')
00925         self.assertEqual(record['IdList'][72], '18410443')
00926         self.assertEqual(record['IdList'][73], '18410442')
00927         self.assertEqual(record['IdList'][74], '18410441')
00928         self.assertEqual(record['IdList'][75], '18410440')
00929         self.assertEqual(record['IdList'][76], '18410439')
00930         self.assertEqual(record['IdList'][77], '18410437')
00931         self.assertEqual(record['IdList'][78], '18410436')
00932         self.assertEqual(record['IdList'][79], '18410435')
00933         self.assertEqual(record['IdList'][80], '18410431')
00934         self.assertEqual(record['IdList'][81], '18410430')
00935         self.assertEqual(record['IdList'][82], '18410428')
00936         self.assertEqual(record['IdList'][83], '18410427')
00937         self.assertEqual(record['IdList'][84], '18410405')
00938         self.assertEqual(record['IdList'][85], '18410404')
00939         self.assertEqual(record['IdList'][86], '18410355')
00940         self.assertEqual(record['IdList'][87], '18410327')
00941         self.assertEqual(record['IdList'][88], '18410312')
00942         self.assertEqual(record['IdList'][89], '18410311')
00943         self.assertEqual(record['IdList'][90], '18410307')
00944         self.assertEqual(record['IdList'][91], '18410259')
00945         self.assertEqual(record['IdList'][92], '18410249')
00946         self.assertEqual(record['IdList'][93], '18410245')
00947         self.assertEqual(record['IdList'][94], '18410243')
00948         self.assertEqual(record['IdList'][95], '18410242')
00949         self.assertEqual(record['IdList'][96], '18410060')
00950         self.assertEqual(record['IdList'][97], '18410013')
00951         self.assertEqual(record['IdList'][98], '18409992')
00952         self.assertEqual(record['IdList'][99], '18409991')
00953         self.assertEqual(len(record['TranslationSet']), 1)
00954         self.assertEqual(record['TranslationSet'][0]['From'], 'cancer')
00955         self.assertEqual(record['TranslationSet'][0]['To'], '(("neoplasms"[TIAB] NOT Medline[SB]) OR "neoplasms"[MeSH Terms] OR cancer[Text Word])')
00956         self.assertEqual(len(record['TranslationStack']), 13)
00957         self.assertEqual(record['TranslationStack'][0]['Term'], '"neoplasms"[TIAB]')
00958         self.assertEqual(record['TranslationStack'][0]['Field'], 'TIAB')
00959         self.assertEqual(record['TranslationStack'][0]['Count'], "52104")
00960         self.assertEqual(record['TranslationStack'][0]['Explode'], 'Y')
00961         self.assertEqual(record['TranslationStack'][1]['Term'], 'Medline[SB]')
00962         self.assertEqual(record['TranslationStack'][1]['Field'], 'SB')
00963         self.assertEqual(record['TranslationStack'][1]['Count'], "16509514")
00964         self.assertEqual(record['TranslationStack'][1]['Explode'], 'Y')
00965         self.assertEqual(record['TranslationStack'][2], 'NOT')
00966         self.assertEqual(record['TranslationStack'][3], 'GROUP')
00967         self.assertEqual(record['TranslationStack'][4]['Term'], '"neoplasms"[MeSH Terms]')
00968         self.assertEqual(record['TranslationStack'][4]['Field'], 'MeSH Terms')
00969         self.assertEqual(record['TranslationStack'][4]['Count'], "1918010")
00970         self.assertEqual(record['TranslationStack'][4]['Explode'], 'Y')
00971         self.assertEqual(record['TranslationStack'][5], 'OR')
00972         self.assertEqual(record['TranslationStack'][6]['Term'], 'cancer[Text Word]')
00973         self.assertEqual(record['TranslationStack'][6]['Field'], 'Text Word')
00974         self.assertEqual(record['TranslationStack'][6]['Count'], "638849")
00975         self.assertEqual(record['TranslationStack'][6]['Explode'], 'Y')
00976         self.assertEqual(record['TranslationStack'][7], 'OR')
00977         self.assertEqual(record['TranslationStack'][8], 'GROUP')
00978         self.assertEqual(record['TranslationStack'][9]['Term'], '2008/02/16[EDAT]')
00979         self.assertEqual(record['TranslationStack'][9]['Field'], 'EDAT')
00980         self.assertEqual(record['TranslationStack'][9]['Count'], "-1")
00981         self.assertEqual(record['TranslationStack'][9]['Explode'], 'Y')
00982         self.assertEqual(record['TranslationStack'][10]['Term'], '2008/04/16[EDAT]')
00983         self.assertEqual(record['TranslationStack'][10]['Field'], 'EDAT')
00984         self.assertEqual(record['TranslationStack'][10]['Count'], "-1")
00985         self.assertEqual(record['TranslationStack'][10]['Explode'], 'Y')
00986         self.assertEqual(record['TranslationStack'][11], 'RANGE')
00987         self.assertEqual(record['TranslationStack'][12], 'AND')
00988         self.assertEqual(record['QueryTranslation'], '(("neoplasms"[TIAB] NOT Medline[SB]) OR "neoplasms"[MeSH Terms] OR cancer[Text Word]) AND 2008/02/16[EDAT] : 2008/04/16[EDAT]')
00989 
00990     def test_pubmed3(self):
00991         '''Test parsing XML returned by ESearch from PubMed (third test)
00992         '''
00993         # Search in PubMed for the journal PNAS Volume 97, and retrieve
00994         # 6 IDs starting at ID 7.
00995         # To create the XML file, use
00996         # >>> Bio.Entrez.esearch(db="pubmed", term="PNAS[ta] AND 97[vi]",
00997         #                        retstart=6, retmax=6)
00998         handle = open('Entrez/esearch3.xml', "rb")
00999         record = Entrez.read(handle)
01000         handle.close()
01001         self.assertEqual(record['Count'], '2652')
01002         self.assertEqual(record['RetMax'], '6')
01003         self.assertEqual(record['RetStart'], '6')
01004         self.assertEqual(len(record['IdList']), 6)
01005         self.assertEqual(record['IdList'][0], '11121077')
01006         self.assertEqual(record['IdList'][1], '11121076')
01007         self.assertEqual(record['IdList'][2], '11121075')
01008         self.assertEqual(record['IdList'][3], '11121074')
01009         self.assertEqual(record['IdList'][4], '11121073')
01010         self.assertEqual(record['IdList'][5], '11121072')
01011         self.assertEqual(len(record['TranslationSet']), 1)
01012         self.assertEqual(record['TranslationSet'][0]['From'], 'PNAS[ta]')
01013         self.assertEqual(record['TranslationSet'][0]['To'], '"Proc Natl Acad Sci U S A"[Journal:__jrid6653]')
01014         self.assertEqual(len(record['TranslationStack']), 3)
01015         self.assertEqual(record['TranslationStack'][0]['Term'], '"Proc Natl Acad Sci U S A"[Journal]')
01016         self.assertEqual(record['TranslationStack'][0]['Field'], 'Journal')
01017         self.assertEqual(record['TranslationStack'][0]['Count'], '91806')
01018         self.assertEqual(record['TranslationStack'][0]['Explode'], 'Y')
01019         self.assertEqual(record['TranslationStack'][1]['Term'], '97[vi]')
01020         self.assertEqual(record['TranslationStack'][1]['Field'], 'vi')
01021         self.assertEqual(record['TranslationStack'][1]['Count'], '58681')
01022         self.assertEqual(record['TranslationStack'][1]['Explode'], 'Y')
01023         self.assertEqual(record['TranslationStack'][2], 'AND')
01024         self.assertEqual(record['QueryTranslation'], '"Proc Natl Acad Sci U S A"[Journal] AND 97[vi]')
01025 
01026     def test_journals(self):
01027         '''Test parsing XML returned by ESearch from the Journals database
01028         '''
01029         # Search in Journals for the term obstetrics.
01030         # To create the XML file, use
01031         # >>> Bio.Entrez.esearch(db="journals", term="obstetrics")
01032         handle = open('Entrez/esearch4.xml', "rb")
01033         record = Entrez.read(handle)
01034         handle.close()
01035         self.assertEqual(record['Count'], '177')
01036         self.assertEqual(record['RetMax'], '20')
01037         self.assertEqual(record['RetStart'], '0')
01038         self.assertEqual(len(record['IdList']), 20)
01039         self.assertEqual(record['IdList'][0], '75')
01040         self.assertEqual(record['IdList'][1], '138')
01041         self.assertEqual(record['IdList'][2], '136')
01042         self.assertEqual(record['IdList'][3], '137')
01043         self.assertEqual(record['IdList'][4], '139')
01044         self.assertEqual(record['IdList'][5], '140')
01045         self.assertEqual(record['IdList'][6], '355')
01046         self.assertEqual(record['IdList'][7], '354')
01047         self.assertEqual(record['IdList'][8], '27731')
01048         self.assertEqual(record['IdList'][9], '439')
01049         self.assertEqual(record['IdList'][10], '564')
01050         self.assertEqual(record['IdList'][11], '617')
01051         self.assertEqual(record['IdList'][12], '749')
01052         self.assertEqual(record['IdList'][13], '735')
01053         self.assertEqual(record['IdList'][14], '815')
01054         self.assertEqual(record['IdList'][15], '905')
01055         self.assertEqual(record['IdList'][16], '903')
01056         self.assertEqual(record['IdList'][17], '932')
01057         self.assertEqual(record['IdList'][18], '933')
01058         self.assertEqual(record['IdList'][19], '875')
01059         self.assertEqual(len(record['TranslationSet']), 0)
01060         self.assertEqual(len(record['TranslationStack']), 2)
01061         self.assertEqual(record['TranslationStack'][0]['Term'], 'obstetrics[All Fields]')
01062         self.assertEqual(record['TranslationStack'][0]['Field'], 'All Fields')
01063         self.assertEqual(record['TranslationStack'][0]['Count'], '177')
01064         self.assertEqual(record['TranslationStack'][0]['Explode'], 'Y')
01065         self.assertEqual(record['TranslationStack'][0].tag, "TermSet")
01066         self.assertEqual(record['TranslationStack'][1], 'GROUP')
01067         self.assertEqual(record['TranslationStack'][1].tag, "OP")
01068         self.assertEqual(record['QueryTranslation'], 'obstetrics[All Fields]')
01069 
01070     def test_pmc(self):
01071         '''Test parsing XML returned by ESearch from PubMed Central
01072         '''
01073         # Search in PubMed Central for stem cells in free fulltext articles.
01074         # To create the XML file, use
01075         # >>> Bio.Entrez.esearch(db="pmc",
01076         #                        term="stem cells AND free fulltext[filter]")
01077         handle = open('Entrez/esearch5.xml', "rb")
01078         record = Entrez.read(handle)
01079         handle.close()
01080         self.assertEqual(record['Count'], '23492')
01081         self.assertEqual(record['RetMax'], '20')
01082         self.assertEqual(record['RetStart'], '0')
01083         self.assertEqual(len(record['IdList']), 20)
01084         self.assertEqual(record['IdList'][0], '1894783')
01085         self.assertEqual(record['IdList'][1], '2064507')
01086         self.assertEqual(record['IdList'][2], '520747')
01087         self.assertEqual(record['IdList'][3], '2043120')
01088         self.assertEqual(record['IdList'][4], '2118723')
01089         self.assertEqual(record['IdList'][5], '1815228')
01090         self.assertEqual(record['IdList'][6], '1253596')
01091         self.assertEqual(record['IdList'][7], '2077853')
01092         self.assertEqual(record['IdList'][8], '1308908')
01093         self.assertEqual(record['IdList'][9], '2233634')
01094         self.assertEqual(record['IdList'][10], '556262')
01095         self.assertEqual(record['IdList'][11], '1925137')
01096         self.assertEqual(record['IdList'][12], '1860068')
01097         self.assertEqual(record['IdList'][13], '1626529')
01098         self.assertEqual(record['IdList'][14], '2217616')
01099         self.assertEqual(record['IdList'][15], '1584276')
01100         self.assertEqual(record['IdList'][16], '2000702')
01101         self.assertEqual(record['IdList'][17], '186324')
01102         self.assertEqual(record['IdList'][18], '1959362')
01103         self.assertEqual(record['IdList'][19], '1413911')
01104         self.assertEqual(len(record['TranslationSet']), 1)
01105         self.assertEqual(record['TranslationSet'][0]['From'], 'stem cells')
01106         self.assertEqual(record['TranslationSet'][0]['To'], '("stem cells"[MeSH Terms] OR stem cells[Acknowledgments] OR stem cells[Figure/Table Caption] OR stem cells[Section Title] OR stem cells[Body - All Words] OR stem cells[Title] OR stem cells[Abstract])')
01107         self.assertEqual(len(record['TranslationStack']), 16)
01108         self.assertEqual(record['TranslationStack'][0]['Term'], '"stem cells"[MeSH Terms]')
01109         self.assertEqual(record['TranslationStack'][0]['Field'], 'MeSH Terms')
01110         self.assertEqual(record['TranslationStack'][0]['Count'], '12224')
01111         self.assertEqual(record['TranslationStack'][0]['Explode'], 'Y')
01112         self.assertEqual(record['TranslationStack'][1]['Term'], 'stem cells[Acknowledgments]')
01113         self.assertEqual(record['TranslationStack'][1]['Field'], 'Acknowledgments')
01114         self.assertEqual(record['TranslationStack'][1]['Count'], '79')
01115         self.assertEqual(record['TranslationStack'][1]['Explode'], 'Y')
01116         self.assertEqual(record['TranslationStack'][2], 'OR')
01117         self.assertEqual(record['TranslationStack'][3]['Term'], 'stem cells[Figure/Table Caption]')
01118         self.assertEqual(record['TranslationStack'][3]['Field'], 'Figure/Table Caption')
01119         self.assertEqual(record['TranslationStack'][3]['Count'], '806')
01120         self.assertEqual(record['TranslationStack'][3]['Explode'], 'Y')
01121         self.assertEqual(record['TranslationStack'][4], 'OR')
01122         self.assertEqual(record['TranslationStack'][5]['Term'], 'stem cells[Section Title]')
01123         self.assertEqual(record['TranslationStack'][5]['Field'], 'Section Title')
01124         self.assertEqual(record['TranslationStack'][5]['Count'], '522')
01125         self.assertEqual(record['TranslationStack'][5]['Explode'], 'Y')
01126         self.assertEqual(record['TranslationStack'][6], 'OR')
01127         self.assertEqual(record['TranslationStack'][7]['Term'], 'stem cells[Body - All Words]')
01128         self.assertEqual(record['TranslationStack'][7]['Field'], 'Body - All Words')
01129         self.assertEqual(record['TranslationStack'][7]['Count'], '13936')
01130         self.assertEqual(record['TranslationStack'][7]['Explode'], 'Y')
01131         self.assertEqual(record['TranslationStack'][8], 'OR')
01132         self.assertEqual(record['TranslationStack'][9]['Term'], 'stem cells[Title]')
01133         self.assertEqual(record['TranslationStack'][9]['Field'], 'Title')
01134         self.assertEqual(record['TranslationStack'][9]['Count'], '1005')
01135         self.assertEqual(record['TranslationStack'][9]['Explode'], 'Y')
01136         self.assertEqual(record['TranslationStack'][10], 'OR')
01137         self.assertEqual(record['TranslationStack'][11]['Term'], 'stem cells[Abstract]')
01138         self.assertEqual(record['TranslationStack'][11]['Field'], 'Abstract')
01139         self.assertEqual(record['TranslationStack'][11]['Count'], '2503')
01140         self.assertEqual(record['TranslationStack'][11]['Explode'], 'Y')
01141         self.assertEqual(record['TranslationStack'][12], 'OR')
01142         self.assertEqual(record['TranslationStack'][13], 'GROUP')
01143         self.assertEqual(record['TranslationStack'][14]['Term'], 'free fulltext[filter]')
01144         self.assertEqual(record['TranslationStack'][14]['Field'], 'filter')
01145         self.assertEqual(record['TranslationStack'][14]['Count'], '1412839')
01146         self.assertEqual(record['TranslationStack'][14]['Explode'], 'Y')
01147         self.assertEqual(record['TranslationStack'][15], 'AND')
01148         self.assertEqual(record['QueryTranslation'], '("stem cells"[MeSH Terms] OR stem cells[Acknowledgments] OR stem cells[Figure/Table Caption] OR stem cells[Section Title] OR stem cells[Body - All Words] OR stem cells[Title] OR stem cells[Abstract]) AND free fulltext[filter]')
01149 
01150     def test_nucleotide(self):
01151         '''Test parsing XML returned by ESearch from the Nucleotide database
01152         '''
01153         # Search in Nucleotide for a property of the sequence,
01154         # To create the XML file, use
01155         # >>> Bio.Entrez.esearch(db="nucleotide", term="biomol trna[prop]")
01156         handle = open('Entrez/esearch6.xml', "rb")
01157         record = Entrez.read(handle)
01158         handle.close()
01159         self.assertEqual(record['Count'], "699")
01160         self.assertEqual(record['RetMax'], "20")
01161         self.assertEqual(record['RetStart'], "0")
01162         self.assertEqual(len(record['IdList']), 20)
01163         self.assertEqual(record['IdList'][0], '220161')
01164         self.assertEqual(record['IdList'][1], '220160')
01165         self.assertEqual(record['IdList'][2], '220159')
01166         self.assertEqual(record['IdList'][3], '220263')
01167         self.assertEqual(record['IdList'][4], '220162')
01168         self.assertEqual(record['IdList'][5], '159885659')
01169         self.assertEqual(record['IdList'][6], '156572228')
01170         self.assertEqual(record['IdList'][7], '2648075')
01171         self.assertEqual(record['IdList'][8], '287595')
01172         self.assertEqual(record['IdList'][9], '402544')
01173         self.assertEqual(record['IdList'][10], '402506')
01174         self.assertEqual(record['IdList'][11], '402505')
01175         self.assertEqual(record['IdList'][12], '287594')
01176         self.assertEqual(record['IdList'][13], '287593')
01177         self.assertEqual(record['IdList'][14], '287592')
01178         self.assertEqual(record['IdList'][15], '287591')
01179         self.assertEqual(record['IdList'][16], '287590')
01180         self.assertEqual(record['IdList'][17], '287589')
01181         self.assertEqual(record['IdList'][18], '287588')
01182         self.assertEqual(record['IdList'][19], '287587')
01183         self.assertEqual(len(record['TranslationSet']), 0)
01184         self.assertEqual(record['QueryTranslation'], '')
01185 
01186     def test_protein(self):
01187         '''Test parsing XML returned by ESearch from the Protein database
01188         '''
01189         # Search in Protein for a molecular weight
01190         # To create the XML file, use
01191         # >>> Bio.Entrez.esearch(db="protein", term="200020[molecular weight]")
01192         handle = open('Entrez/esearch7.xml', "rb")
01193         record = Entrez.read(handle)
01194         handle.close()
01195         self.assertEqual(record['Count'], '3')
01196         self.assertEqual(record['RetMax'], '3')
01197         self.assertEqual(record['RetStart'], '0')
01198         self.assertEqual(len(record['IdList']), 3)
01199         self.assertEqual(record['IdList'][0], '16766766')
01200         self.assertEqual(record['IdList'][1], '16422035')
01201         self.assertEqual(record['IdList'][2], '4104812')
01202         self.assertEqual(len(record['TranslationSet']), 0)
01203         self.assertEqual(len(record['TranslationStack']), 2)
01204         self.assertEqual(record['TranslationStack'][0]['Term'], '000200020[molecular weight]')
01205         self.assertEqual(record['TranslationStack'][0]['Field'], 'molecular weight')
01206         self.assertEqual(record['TranslationStack'][0]['Count'], '3')
01207         self.assertEqual(record['TranslationStack'][0]['Explode'], 'Y')
01208         self.assertEqual(record['TranslationStack'][1], 'GROUP')
01209         self.assertEqual(record['QueryTranslation'], '000200020[molecular weight]')
01210 
01211     def test_notfound(self):
01212         '''Test parsing XML returned by ESearch when no items were found
01213         '''
01214         # To create the XML file, use
01215         # >>> Bio.Entrez.esearch(db="protein", term="abcXYZ")
01216         handle = open('Entrez/esearch8.xml')
01217         record = Entrez.read(handle)
01218         handle.close()
01219         self.assertEqual(record['Count'], '3')
01220         self.assertEqual(record['RetMax'], '3')
01221         self.assertEqual(record['RetStart'], '0')
01222         self.assertEqual(len(record['IdList']), 3)
01223         self.assertEqual(record['IdList'][0], '16766766')
01224         self.assertEqual(record['IdList'][1], '16422035')
01225         self.assertEqual(record['IdList'][2], '4104812')
01226         self.assertEqual(len(record['TranslationSet']), 0)
01227         self.assertEqual(len(record['TranslationStack']), 2)
01228         self.assertEqual(record['TranslationStack'][0]['Term'], '000200020[molecular weight]')
01229         self.assertEqual(record['TranslationStack'][0]['Field'], 'molecular weight')
01230         self.assertEqual(record['TranslationStack'][0]['Count'], '3')
01231         self.assertEqual(record['TranslationStack'][0]['Explode'], 'Y')
01232         self.assertEqual(record['TranslationStack'][1], 'GROUP')
01233         self.assertEqual(record['QueryTranslation'], '000200020[molecular weight]')
01234 
01235     def test_notfound(self):
01236         '''Test parsing XML returned by ESearch when no items were found
01237         '''
01238         # To create the XML file, use
01239         # >>> Bio.Entrez.esearch(db="protein", term="abcXYZ")
01240         handle = open('Entrez/esearch8.xml', "rb")
01241         record = Entrez.read(handle)
01242         handle.close()
01243         self.assertEqual(record['Count'], "0")
01244         self.assertEqual(record['RetMax'], "0")
01245         self.assertEqual(record['RetStart'], "0")
01246         self.assertEqual(len(record['IdList']), 0)
01247         self.assertEqual(len(record['TranslationSet']), 0)
01248         self.assertEqual(record['QueryTranslation'], '')
01249         self.assertEqual(len(record['ErrorList']), 2)
01250         self.assertTrue("PhraseNotFound" in record['ErrorList'])
01251         self.assertTrue("FieldNotFound" in record['ErrorList'])
01252         self.assertEqual(len(record['ErrorList']["PhraseNotFound"]), 1)
01253         self.assertEqual(len(record['ErrorList']["FieldNotFound"]), 0)
01254         self.assertEqual(record['ErrorList']["PhraseNotFound"][0], "abcXYZ")
01255         self.assertEqual(len(record['WarningList']), 3)
01256         self.assertTrue("PhraseIgnored" in record['WarningList'])
01257         self.assertTrue("QuotedPhraseNotFound" in record['WarningList'])
01258         self.assertTrue("OutputMessage" in record['WarningList'])
01259         self.assertEqual(len(record['WarningList']["PhraseIgnored"]), 0)
01260         self.assertEqual(len(record['WarningList']["QuotedPhraseNotFound"]), 0)
01261         self.assertEqual(len(record['WarningList']["OutputMessage"]), 1)
01262         self.assertEqual(record['WarningList']["OutputMessage"][0], "No items found.")
01263 
01264 class EPostTest(unittest.TestCase):
01265     '''Tests for parsing XML output returned by EPost
01266     '''
01267     # Don't know how to get an InvalidIdList in the XML returned by EPost;
01268     # unable to test if we are parsing it correctly.
01269     def test_epost(self):
01270         '''Test parsing XML returned by EPost
01271         '''
01272         # To create the XML file, use
01273         # >>> Bio.Entrez.epost(db="pubmed", id="11237011")
01274         handle = open('Entrez/epost1.xml', "rb")
01275         record = Entrez.read(handle)
01276         handle.close()
01277         self.assertEqual(record["QueryKey"],  '1')
01278         self.assertEqual(record["WebEnv"], '0zYsuLk3zG_lRMkblPBEqnT8nIENUGw4HAy8xXChTnoVm7GEnWY71jv3nz@1FC077F3806DE010_0042SID')
01279 
01280     def test_wrong(self):
01281         '''Test parsing XML returned by EPost with incorrect arguments
01282         '''
01283         # To create the XML file, use
01284         # >>> Bio.Entrez.epost(db="nothing")
01285         handle = open('Entrez/epost2.xml', "rb")
01286         self.assertRaises(RuntimeError, Entrez.read, handle)
01287         handle.close()
01288 
01289     def test_invalid(self):
01290         '''Test parsing XML returned by EPost with an invalid id (overflow tag)
01291         '''
01292         # To create the XML file, use
01293         # >>> Bio.Entrez.epost(db="pubmed", id=99999999999999999999999999999999)
01294         handle = open('Entrez/epost3.xml', "rb")
01295         record = Entrez.read(handle)
01296         handle.close()
01297         self.assertEqual(record["InvalidIdList"], ["-1"])
01298         self.assertEqual(record["QueryKey"], "1")
01299         self.assertEqual(record["WebEnv"], "08AIUeBsfIk6BfdzKnd3GM2RtCudczC9jm5aeb4US0o7azCTQCeCsr-xg0@1EDE54E680D03C40_0011SID")
01300 
01301 
01302 class ESummaryTest(unittest.TestCase):
01303     '''Tests for parsing XML output returned by ESummary
01304     '''
01305     # Items have a type, which can be
01306     # (Integer|Date|String|Structure|List|Flags|Qualifier|Enumerator|Unknown)
01307     # I don't have an XML file where the type "Flags", "Qualifier",
01308     # "Enumerator", or "Unknown" is used, so they are not tested here.
01309     def test_pubmed(self):
01310         '''Test parsing XML returned by ESummary from PubMed
01311         '''
01312         # In PubMed display records for PMIDs 11850928 and 11482001 in
01313         # xml retrieval mode
01314         # To create the XML file, use
01315         # >>> Bio.Entrez.esummary(db="pubmed", id=["11850928","11482001"],
01316         #                         retmode="xml")
01317         handle = open('Entrez/esummary1.xml', "rb")
01318         record = Entrez.read(handle)
01319         handle.close()
01320         self.assertEqual(record[0]["Id"], "11850928")
01321         self.assertEqual(record[0]["PubDate"], "1965 Aug")
01322         self.assertEqual(record[0]["EPubDate"], "")
01323         self.assertEqual(record[0]["Source"], "Arch Dermatol")
01324         self.assertEqual(len(record[0]["AuthorList"]), 2)
01325         self.assertEqual(record[0]["AuthorList"][0], "LoPresti PJ")
01326         self.assertEqual(record[0]["AuthorList"][1], "Hambrick GW Jr")
01327         self.assertEqual(record[0]["LastAuthor"], "Hambrick GW Jr")
01328         self.assertEqual(record[0]["Title"], "Zirconium granuloma following treatment of rhus dermatitis.")
01329         self.assertEqual(record[0]["Volume"], "92")
01330         self.assertEqual(record[0]["Issue"], "2")
01331         self.assertEqual(record[0]["Pages"], "188-91")
01332         self.assertEqual(record[0]["LangList"], ["English"])
01333         self.assertEqual(record[0]["NlmUniqueID"], "0372433")
01334         self.assertEqual(record[0]["ISSN"], "0003-987X")
01335         self.assertEqual(record[0]["ESSN"], "1538-3652")
01336         self.assertEqual(len(record[0]["PubTypeList"]), 1)
01337         self.assertEqual(record[0]["PubTypeList"][0], "Journal Article")
01338         self.assertEqual(record[0]["RecordStatus"], "PubMed - indexed for MEDLINE")
01339         self.assertEqual(record[0]["PubStatus"], "ppublish")
01340         self.assertEqual(len(record[0]["ArticleIds"]), 2)
01341         self.assertEqual(record[0]["ArticleIds"]["pubmed"], ["11850928"])
01342         self.assertEqual(record[0]["ArticleIds"]["medline"], [])
01343         self.assertEqual(len(record[0]["History"]), 2)
01344         self.assertEqual(record[0]["History"]["pubmed"], ["1965/08/01 00:00"])
01345         self.assertEqual(record[0]["History"]["medline"], ["2002/03/09 10:01"])
01346         self.assertEqual(len(record[0]["References"]), 0)
01347         self.assertEqual(record[0]["HasAbstract"], 1)
01348         self.assertEqual(record[0]["PmcRefCount"], 0)
01349         self.assertEqual(record[0]["FullJournalName"], "Archives of dermatology")
01350         self.assertEqual(record[0]["ELocationID"], "")
01351         self.assertEqual(record[0]["SO"], "1965 Aug;92(2):188-91")
01352 
01353         self.assertEqual(record[1]["Id"], "11482001")
01354         self.assertEqual(record[1]["PubDate"], "2001 Jun")
01355         self.assertEqual(record[1]["EPubDate"], "")
01356         self.assertEqual(record[1]["Source"], "Adverse Drug React Toxicol Rev")
01357         self.assertEqual(len(record[1]["AuthorList"]), 3)
01358         self.assertEqual(record[1]["AuthorList"][0], "Mantle D")
01359         self.assertEqual(record[1]["AuthorList"][1], "Gok MA")
01360         self.assertEqual(record[1]["AuthorList"][2], "Lennard TW")
01361         self.assertEqual(record[1]["LastAuthor"], "Lennard TW")
01362         self.assertEqual(record[1]["Title"], "Adverse and beneficial effects of plant extracts on skin and skin disorders.")
01363         self.assertEqual(record[1]["Volume"], "20")
01364         self.assertEqual(record[1]["Issue"], "2")
01365         self.assertEqual(record[1]["Pages"], "89-103")
01366         self.assertEqual(len(record[1]["LangList"]), 1)
01367         self.assertEqual(record[1]["LangList"][0], "English")
01368         self.assertEqual(record[1]["NlmUniqueID"], "9109474")
01369         self.assertEqual(record[1]["ISSN"], "0964-198X")
01370         self.assertEqual(record[1]["ESSN"], "")
01371         self.assertEqual(len(record[1]["PubTypeList"]), 2)
01372         self.assertEqual(record[1]["PubTypeList"][0], "Journal Article")
01373         self.assertEqual(record[1]["PubTypeList"][1], "Review")
01374         self.assertEqual(record[1]["RecordStatus"], "PubMed - indexed for MEDLINE")
01375         self.assertEqual(record[1]["PubStatus"], "ppublish")
01376         self.assertEqual(len(record[1]["ArticleIds"]), 2)
01377         self.assertEqual(record[1]["ArticleIds"]["pubmed"], ["11482001"])
01378         self.assertEqual(record[1]["ArticleIds"]["medline"], [])
01379         self.assertEqual(len(record[1]["History"]), 2)
01380         self.assertEqual(record[1]["History"]["pubmed"], ["2001/08/03 10:00"])
01381         self.assertEqual(record[1]["History"]["medline"], ["2002/01/23 10:01"])
01382         self.assertEqual(len(record[1]["References"]), 0)
01383         self.assertEqual(record[1]["HasAbstract"], 1)
01384         self.assertEqual(record[1]["PmcRefCount"], 0)
01385         self.assertEqual(record[1]["FullJournalName"], "Adverse drug reactions and toxicological reviews")
01386         self.assertEqual(record[1]["ELocationID"], "")
01387         self.assertEqual(record[1]["SO"], "2001 Jun;20(2):89-103")
01388 
01389     def test_journals(self):
01390         '''Test parsing XML returned by ESummary from the Journals database
01391         '''
01392         # In Journals display records for journal IDs 27731,439,735,905 
01393         # To create the XML file, use
01394         # >>> Bio.Entrez.esummary(db="journals", id="27731,439,735,905")
01395         handle = open('Entrez/esummary2.xml', "rb")
01396         record = Entrez.read(handle)
01397         handle.close()
01398         self.assertEqual(record[0]["Id"], "27731")
01399         self.assertEqual(record[0]["Title"], "The American journal of obstetrics and diseases of women and children")
01400         self.assertEqual(record[0]["MedAbbr"], "Am J Obstet Dis Women Child")
01401         self.assertEqual(record[0]["IsoAbbr"], "")
01402         self.assertEqual(record[0]["NlmId"], "14820330R")
01403         self.assertEqual(record[0]["pISSN"], "0894-5543")
01404         self.assertEqual(record[0]["eISSN"], "")
01405         self.assertEqual(record[0]["PublicationStartYear"], "1868")
01406         self.assertEqual(record[0]["PublicationEndYear"], "1919")
01407         self.assertEqual(record[0]["Publisher"], "W.A. Townsend & Adams, $c [1868-1919]")
01408         self.assertEqual(record[0]["Language"], "eng")
01409         self.assertEqual(record[0]["Country"], "United States")
01410         self.assertEqual(len(record[0]["BroadHeading"]), 0)
01411         self.assertEqual(record[0]["ContinuationNotes"], "")
01412 
01413         self.assertEqual(record[1]["Id"], "439")
01414         self.assertEqual(record[1]["Title"], "American journal of obstetrics and gynecology")
01415         self.assertEqual(record[1]["MedAbbr"], "Am J Obstet Gynecol")
01416         self.assertEqual(record[1]["IsoAbbr"], "Am. J. Obstet. Gynecol.")
01417         self.assertEqual(record[1]["NlmId"], "0370476")
01418         self.assertEqual(record[1]["pISSN"], "0002-9378")
01419         self.assertEqual(record[1]["eISSN"], "1097-6868")
01420         self.assertEqual(record[1]["PublicationStartYear"], "1920")
01421         self.assertEqual(record[1]["PublicationEndYear"], "")
01422         self.assertEqual(record[1]["Publisher"], "Elsevier,")
01423         self.assertEqual(record[1]["Language"], "eng")
01424         self.assertEqual(record[1]["Country"], "United States")
01425         self.assertEqual(len(record[1]["BroadHeading"]), 2)
01426         self.assertEqual(record[1]["BroadHeading"][0], "Gynecology")
01427         self.assertEqual(record[1]["BroadHeading"][1], "Obstetrics")
01428         self.assertEqual(record[1]["ContinuationNotes"], "Continues: American journal of obstetrics and diseases of women and children. ")
01429 
01430         self.assertEqual(record[2]["Id"], "735")
01431         self.assertEqual(record[2]["Title"], "Archives of gynecology and obstetrics")
01432         self.assertEqual(record[2]["MedAbbr"], "Arch Gynecol Obstet")
01433         self.assertEqual(record[2]["IsoAbbr"], "Arch. Gynecol. Obstet.")
01434         self.assertEqual(record[2]["NlmId"], "8710213")
01435         self.assertEqual(record[2]["pISSN"], "0932-0067")
01436         self.assertEqual(record[2]["eISSN"], "1432-0711")
01437         self.assertEqual(record[2]["PublicationStartYear"], "1987")
01438         self.assertEqual(record[2]["PublicationEndYear"], "")
01439         self.assertEqual(record[2]["Publisher"], "Springer Verlag")
01440         self.assertEqual(record[2]["Language"], "eng")
01441         self.assertEqual(record[2]["Country"], "Germany")
01442         self.assertEqual(len(record[2]["BroadHeading"]), 2)
01443         self.assertEqual(record[2]["BroadHeading"][0], "Gynecology")
01444         self.assertEqual(record[2]["BroadHeading"][1], "Obstetrics")
01445         self.assertEqual(record[2]["ContinuationNotes"], "Continues: Archives of gynecology. ")
01446 
01447         self.assertEqual(record[3]["Id"], "905")
01448         self.assertEqual(record[3]["Title"], "Asia-Oceania journal of obstetrics and gynaecology / AOFOG")
01449         self.assertEqual(record[3]["MedAbbr"], "Asia Oceania J Obstet Gynaecol")
01450         self.assertEqual(record[3]["IsoAbbr"], "")
01451         self.assertEqual(record[3]["NlmId"], "8102781")
01452         self.assertEqual(record[3]["pISSN"], "0389-2328")
01453         self.assertEqual(record[3]["eISSN"], "")
01454         self.assertEqual(record[3]["PublicationStartYear"], "1980")
01455         self.assertEqual(record[3]["PublicationEndYear"], "1994")
01456         self.assertEqual(record[3]["Publisher"], "University Of Tokyo Press")
01457         self.assertEqual(record[3]["Language"], "eng")
01458         self.assertEqual(record[3]["Country"], "Japan")
01459         self.assertEqual(len(record[3]["BroadHeading"]), 2)
01460         self.assertEqual(record[3]["BroadHeading"][0], "Gynecology")
01461         self.assertEqual(record[3]["BroadHeading"][1], "Obstetrics")
01462         self.assertEqual(record[3]["ContinuationNotes"], "Continues: Journal of the Asian Federation of Obstetrics and Gynaecology. Continued by: Journal of obstetrics and gynaecology (Tokyo, Japan). ")
01463 
01464     def test_protein(self):
01465         '''Test parsing XML returned by ESummary from the Protein database
01466         '''
01467         # In Protein display records for GIs 28800982 and 28628843 in xml retrieval mode
01468         # To create the XML file, use
01469         # >>> Bio.Entrez.esummary(db="protein", id="28800982,28628843", retmode="xml")
01470         handle = open('Entrez/esummary3.xml', "rb")
01471         record = Entrez.read(handle)
01472         handle.close()
01473         self.assertEqual(record[0]["Id"], "28800982")
01474         self.assertEqual(record[0]["Caption"], "AAO47091")
01475         self.assertEqual(record[0]["Title"], "hemochromatosis [Homo sapiens]")
01476         self.assertEqual(record[0]["Extra"], "gi|28800982|gb|AAO47091.1|[28800982]")
01477         self.assertEqual(record[0]["Gi"], 28800982)
01478         self.assertEqual(record[0]["CreateDate"], "2003/03/03")
01479         self.assertEqual(record[0]["UpdateDate"], "2003/03/03")
01480         self.assertEqual(record[0]["Flags"], 0)
01481         self.assertEqual(record[0]["TaxId"], 9606)
01482         self.assertEqual(record[0]["Length"], 268)
01483         self.assertEqual(record[0]["Status"], "live")
01484         self.assertEqual(record[0]["ReplacedBy"], "")
01485         self.assertEqual(record[0]["Comment"], "  ")
01486 
01487         self.assertEqual(record[1]["Id"], "28628843")
01488         self.assertEqual(record[1]["Caption"], "AAO49381")
01489         self.assertEqual(record[1]["Title"], "erythroid associated factor [Homo sapiens]")
01490         self.assertEqual(record[1]["Extra"], "gi|28628843|gb|AAO49381.1|AF485325_1[28628843]")
01491         self.assertEqual(record[1]["Gi"],  28628843)
01492         self.assertEqual(record[1]["CreateDate"], "2003/03/02")
01493         self.assertEqual(record[1]["UpdateDate"], "2003/03/02")
01494         self.assertEqual(record[1]["Flags"], 0)
01495         self.assertEqual(record[1]["TaxId"], 9606)
01496         self.assertEqual(record[1]["Length"], 102)
01497         self.assertEqual(record[1]["Status"], "live")
01498         self.assertEqual(record[1]["ReplacedBy"], "")
01499         self.assertEqual(record[1]["Comment"], "  ")
01500 
01501     def test_nucleotide(self):
01502         '''Test parsing XML returned by ESummary from the Nucleotide database
01503         '''
01504         # In Nucleotide display records for GIs 28864546 and 28800981
01505         # in xml retrieval mode
01506         # To create the XML file, use
01507         # >>> Bio.Entrez.esummary(db="nucleotide", id="28864546,28800981",
01508         #                         retmode="xml")
01509         handle = open('Entrez/esummary4.xml', "rb")
01510         record = Entrez.read(handle)
01511         handle.close()
01512         self.assertEqual(record[0]["Id"], "28864546")
01513         self.assertEqual(record[0]["Caption"], "AY207443")
01514         self.assertEqual(record[0]["Title"], "Homo sapiens alpha hemoglobin (HBZP) pseudogene 3' UTR/AluJo repeat breakpoint junction")
01515         self.assertEqual(record[0]["Extra"], "gi|28864546|gb|AY207443.1|[28864546]")
01516         self.assertEqual(record[0]["Gi"], 28864546)
01517         self.assertEqual(record[0]["CreateDate"], "2003/03/05")
01518         self.assertEqual(record[0]["UpdateDate"], "2003/03/05")
01519         self.assertEqual(record[0]["Flags"], 0)
01520         self.assertEqual(record[0]["TaxId"], 9606)
01521         self.assertEqual(record[0]["Length"], 491)
01522         self.assertEqual(record[0]["Status"], "live")
01523         self.assertEqual(record[0]["ReplacedBy"], "")
01524         self.assertEqual(record[0]["Comment"], "  ")
01525 
01526         self.assertEqual(record[1]["Id"], "28800981")
01527         self.assertEqual(record[1]["Caption"], "AY205604")
01528         self.assertEqual(record[1]["Title"], "Homo sapiens hemochromatosis (HFE) mRNA, partial cds")
01529         self.assertEqual(record[1]["Extra"], "gi|28800981|gb|AY205604.1|[28800981]")
01530         self.assertEqual(record[1]["Gi"], 28800981)
01531         self.assertEqual(record[1]["CreateDate"], "2003/03/03")
01532         self.assertEqual(record[1]["UpdateDate"], "2003/03/03")
01533         self.assertEqual(record[1]["Flags"], 0)
01534         self.assertEqual(record[1]["TaxId"], 9606)
01535         self.assertEqual(record[1]["Length"], 860)
01536         self.assertEqual(record[1]["Status"], "live")
01537         self.assertEqual(record[1]["ReplacedBy"], "")
01538         self.assertEqual(record[1]["Comment"], "  ")
01539 
01540     def test_structure(self):
01541         '''Test parsing XML returned by ESummary from the Structure database
01542         '''
01543         # In Nucleotide display records for GIs 28864546 and 28800981
01544         # in xml retrieval mode
01545         # To create the XML file, use
01546         # >>> Bio.Entrez.esummary(db="structure", id=["19923","12120"],
01547         #                         retmode="xml")
01548         handle = open('Entrez/esummary5.xml', "rb")
01549         record = Entrez.read(handle)
01550         handle.close()
01551         self.assertEqual(record[0]["Id"], "19923")
01552         self.assertEqual(record[0]["PdbAcc"], "1L5J")
01553         self.assertEqual(record[0]["PdbDescr"], "Crystal Structure Of E. Coli Aconitase B")
01554         self.assertEqual(record[0]["EC"], "4.2.1.3")
01555         self.assertEqual(record[0]["Resolution"], "2.4")
01556         self.assertEqual(record[0]["ExpMethod"], "X-Ray Diffraction")
01557         self.assertEqual(record[0]["PdbClass"], "Lyase")
01558         self.assertEqual(record[0]["PdbReleaseDate"], "2007/8/27")
01559         self.assertEqual(record[0]["PdbDepositDate"], "2002/3/7")
01560         self.assertEqual(record[0]["DepositDate"], "2007/10/25")
01561         self.assertEqual(record[0]["ModifyDate"], "2007/10/25")
01562         self.assertEqual(record[0]["LigCode"], "F3S|TRA")
01563         self.assertEqual(record[0]["LigCount"], "2")
01564         self.assertEqual(record[0]["ModProteinResCount"], "0")
01565         self.assertEqual(record[0]["ModDNAResCount"], "0")
01566         self.assertEqual(record[0]["ModRNAResCount"], "0")
01567         self.assertEqual(record[0]["ProteinChainCount"], "2")
01568         self.assertEqual(record[0]["DNAChainCount"], "0")
01569         self.assertEqual(record[0]["RNAChainCount"], "0")
01570 
01571         self.assertEqual(record[1]["Id"], "12120")
01572         self.assertEqual(record[1]["PdbAcc"], "1B0K")
01573         self.assertEqual(record[1]["PdbDescr"], "S642a:fluorocitrate Complex Of Aconitase")
01574         self.assertEqual(record[1]["EC"], "4.2.1.3")
01575         self.assertEqual(record[1]["Resolution"], "2.5")
01576         self.assertEqual(record[1]["ExpMethod"], "X-Ray Diffraction")
01577         self.assertEqual(record[1]["PdbClass"], "Lyase")
01578         self.assertEqual(record[1]["PdbReleaseDate"], "2007/8/27")
01579         self.assertEqual(record[1]["PdbDepositDate"], "1998/11/11")
01580         self.assertEqual(record[1]["DepositDate"], "2007/10/07")
01581         self.assertEqual(record[1]["ModifyDate"], "2007/10/07")
01582         self.assertEqual(record[1]["LigCode"], "FLC|O|SF4")
01583         self.assertEqual(record[1]["LigCount"], "3")
01584         self.assertEqual(record[1]["ModProteinResCount"], "0")
01585         self.assertEqual(record[1]["ModDNAResCount"], "0")
01586         self.assertEqual(record[1]["ModRNAResCount"], "0")
01587         self.assertEqual(record[1]["ProteinChainCount"], "1")
01588         self.assertEqual(record[1]["DNAChainCount"], "0")
01589         self.assertEqual(record[1]["RNAChainCount"], "0")
01590 
01591     def test_taxonomy(self):
01592         '''Test parsing XML returned by ESummary from the Taxonomy database
01593         '''
01594         # In Taxonomy display records for TAXIDs 9913 and 30521 in
01595         # xml retrieval mode 
01596         # To create the XML file, use
01597         # >>> Bio.Entrez.esummary(db="taxonomy", id=["9913","30521"],
01598         #                         retmode="xml")
01599         handle = open('Entrez/esummary6.xml', "rb")
01600         record = Entrez.read(handle)
01601         handle.close()
01602         self.assertEqual(record[0]["Id"], "9913")
01603         self.assertEqual(record[0]["Rank"], "species")
01604         self.assertEqual(record[0]["Division"], "even-toed ungulates")
01605         self.assertEqual(record[0]["ScientificName"], "Bos taurus")
01606         self.assertEqual(record[0]["CommonName"], "cattle")
01607         self.assertEqual(record[0]["TaxId"], 9913)
01608         self.assertEqual(record[0]["NucNumber"], 2264214)
01609         self.assertEqual(record[0]["ProtNumber"], 55850)
01610         self.assertEqual(record[0]["StructNumber"], 1517)
01611         self.assertEqual(record[0]["GenNumber"], 31)
01612         self.assertEqual(record[0]["GeneNumber"], 29651)
01613         self.assertEqual(record[0]["Genus"], "")
01614         self.assertEqual(record[0]["Species"], "")
01615         self.assertEqual(record[0]["Subsp"], "")
01616 
01617         self.assertEqual(record[1]["Id"], "30521")
01618         self.assertEqual(record[1]["Rank"], "species")
01619         self.assertEqual(record[1]["Division"], "even-toed ungulates")
01620         self.assertEqual(record[1]["ScientificName"], "Bos grunniens")
01621         self.assertEqual(record[1]["CommonName"], "domestic yak")
01622         self.assertEqual(record[1]["TaxId"], 30521)
01623         self.assertEqual(record[1]["NucNumber"], 560)
01624         self.assertEqual(record[1]["ProtNumber"], 254)
01625         self.assertEqual(record[1]["StructNumber"], 0)
01626         self.assertEqual(record[1]["GenNumber"], 1)
01627         self.assertEqual(record[1]["GeneNumber"], 13)
01628         self.assertEqual(record[1]["Genus"], "")
01629         self.assertEqual(record[1]["Species"], "")
01630         self.assertEqual(record[1]["Subsp"], "")
01631 
01632     def test_unists(self):
01633         '''Test parsing XML returned by ESummary from the UniSTS database
01634         '''
01635         # In UniSTS display records for IDs 254085 and 254086 in xml
01636         # retrieval mode 
01637         # To create the XML file, use
01638         # >>> Bio.Entrez.esummary(db="unists", id=["254085","254086"],
01639         #                         retmode="xml")
01640         handle = open('Entrez/esummary7.xml', "rb")
01641         record = Entrez.read(handle)
01642         handle.close()
01643         self.assertEqual(record[0]["Id"], "254085")
01644         self.assertEqual(record[0]["Marker_Name"], "SE234324")
01645         self.assertEqual(len(record[0]["Map_Gene_Summary_List"]), 1)
01646         self.assertEqual(record[0]["Map_Gene_Summary_List"][0]["Org"], "Sus scrofa")
01647         self.assertEqual(record[0]["Map_Gene_Summary_List"][0]["Chr"], " chromosome 7")
01648         self.assertEqual(record[0]["Map_Gene_Summary_List"][0]["Locus"], "")
01649         self.assertEqual(record[0]["EPCR_Summary"], "Found by e-PCR in sequences from Sus scrofa.")
01650         self.assertEqual(record[0]["LocusId"], "")
01651 
01652         self.assertEqual(record[1]["Id"], "254086")
01653         self.assertEqual(record[1]["Marker_Name"], "SE259162")
01654         self.assertEqual(len(record[1]["Map_Gene_Summary_List"]), 1)
01655         self.assertEqual(record[1]["Map_Gene_Summary_List"][0]["Org"], "Sus scrofa")
01656         self.assertEqual(record[1]["Map_Gene_Summary_List"][0]["Chr"], " chromosome 12")
01657         self.assertEqual(record[1]["Map_Gene_Summary_List"][0]["Locus"], "")
01658         self.assertEqual(record[1]["EPCR_Summary"], "Found by e-PCR in sequences from Sus scrofa.")
01659         self.assertEqual(record[1]["LocusId"], "")
01660 
01661     def test_wrong(self):
01662         '''Test parsing XML returned by ESummary with incorrect arguments
01663         '''
01664         # To create the XML file, use
01665         # >>> Bio.Entrez.esummary()
01666         handle = open('Entrez/esummary8.xml', "rb")
01667         self.assertRaises(RuntimeError, Entrez.read, handle)
01668         handle.close()
01669 
01670 
01671 class ELinkTest(unittest.TestCase):
01672     '''Tests for parsing XML output returned by ELink
01673     '''
01674     def test_pubmed1(self):
01675         '''Test parsing pubmed links returned by ELink (first test)
01676         '''
01677         # Retrieve IDs from PubMed for PMID 9298984 to the PubMed database
01678         # To create the XML file, use
01679         # >>> Bio.Entrez.elink(dbfrom="pubmed", id="9298984", cmd="neighbor")
01680         handle = open('Entrez/elink1.xml', "rb")
01681         record = Entrez.read(handle)
01682         handle.close()
01683         self.assertEqual(len(record), 1)
01684         self.assertEqual(record[0]["DbFrom"], "pubmed")
01685         self.assertEqual(record[0]["IdList"], ["9298984"])
01686         self.assertEqual(record[0]["LinkSetDb"][0]["DbTo"], "pubmed")
01687         self.assertEqual(record[0]["LinkSetDb"][0]["LinkName"], "pubmed_pubmed")
01688         self.assertEqual(len(record[0]["LinkSetDb"][0]["Link"]), 144)
01689         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][0]["Id"], "9298984")
01690         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][0]["Score"], "2147483647")
01691         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][1]["Id"], "8794856")
01692         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][1]["Score"], "65259341")
01693         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][2]["Id"], "9700164")
01694         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][2]["Score"], "60347327")
01695         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][3]["Id"], "7914521")
01696         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][3]["Score"], "54343405")
01697         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][4]["Id"], "1339459")
01698         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][4]["Score"], "53014422")
01699         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][5]["Id"], "9914369")
01700         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][5]["Score"], "52741538")
01701         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][6]["Id"], "11590237")
01702         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][6]["Score"], "52493903")
01703         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][7]["Id"], "12686595")
01704         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][7]["Score"], "48734007")
01705         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][8]["Id"], "9074495")
01706         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][8]["Score"], "48220447")
01707         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][9]["Id"], "11146659")
01708         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][9]["Score"], "46604626")
01709         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][10]["Id"], "10893249")
01710         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][10]["Score"], "46254167")
01711         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][11]["Id"], "8978614")
01712         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][11]["Score"], "46166362")
01713         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][12]["Id"], "15371539")
01714         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][12]["Score"], "45060488")
01715         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][13]["Id"], "10806105")
01716         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][13]["Score"], "44825774")
01717         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][14]["Id"], "10402457")
01718         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][14]["Score"], "44338522")
01719         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][15]["Id"], "10545493")
01720         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][15]["Score"], "43860609")
01721         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][16]["Id"], "10523511")
01722         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][16]["Score"], "43268800")
01723         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][17]["Id"], "12515822")
01724         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][17]["Score"], "43215343")
01725         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][18]["Id"], "15915585")
01726         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][18]["Score"], "43029760")
01727         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][19]["Id"], "11483958")
01728         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][19]["Score"], "42348877")
01729         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][20]["Id"], "11685532")
01730         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][20]["Score"], "42262104")
01731         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][21]["Id"], "9869638")
01732         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][21]["Score"], "41143593")
01733         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][22]["Id"], "12080088")
01734         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][22]["Score"], "40849490")
01735         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][23]["Id"], "12034769")
01736         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][23]["Score"], "40841328")
01737         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][24]["Id"], "9852156")
01738         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][24]["Score"], "40793501")
01739         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][25]["Id"], "9735366")
01740         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][25]["Score"], "40661605")
01741         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][26]["Id"], "10749938")
01742         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][26]["Score"], "40486739")
01743         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][27]["Id"], "9490715")
01744         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][27]["Score"], "40311339")
01745         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][28]["Id"], "9425896")
01746         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][28]["Score"], "40056298")
01747         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][29]["Id"], "11266459")
01748         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][29]["Score"], "39883140")
01749         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][30]["Id"], "14522947")
01750         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][30]["Score"], "39683976")
01751         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][31]["Id"], "15616189")
01752         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][31]["Score"], "39518630")
01753         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][32]["Id"], "16732327")
01754         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][32]["Score"], "39425668")
01755         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][33]["Id"], "11179694")
01756         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][33]["Score"], "39183565")
01757         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][34]["Id"], "10898791")
01758         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][34]["Score"], "39159761")
01759         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][35]["Id"], "11146661")
01760         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][35]["Score"], "39116609")
01761         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][36]["Id"], "11914278")
01762         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][36]["Score"], "39028004")
01763         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][37]["Id"], "10985388")
01764         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][37]["Score"], "39002572")
01765         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][38]["Id"], "16839185")
01766         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][38]["Score"], "38916726")
01767         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][39]["Id"], "7585942")
01768         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][39]["Score"], "38747288")
01769         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][40]["Id"], "2022189")
01770         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][40]["Score"], "38717145")
01771         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][41]["Id"], "7690762")
01772         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][41]["Score"], "38647275")
01773         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][42]["Id"], "7904902")
01774         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][42]["Score"], "38557343")
01775         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][43]["Id"], "9378750")
01776         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][43]["Score"], "38484849")
01777         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][44]["Id"], "12388768")
01778         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][44]["Score"], "38454422")
01779         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][45]["Id"], "11352945")
01780         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][45]["Score"], "38449836")
01781         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][46]["Id"], "11267866")
01782         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][46]["Score"], "38419058")
01783         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][47]["Id"], "17222555")
01784         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][47]["Score"], "38368546")
01785         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][48]["Id"], "11252055")
01786         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][48]["Score"], "38257516")
01787         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][49]["Id"], "16585270")
01788         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][49]["Score"], "37800856")
01789         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][50]["Id"], "9606208")
01790         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][50]["Score"], "37669054")
01791         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][51]["Id"], "17182852")
01792         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][51]["Score"], "37621285")
01793         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][52]["Id"], "9933569")
01794         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][52]["Score"], "37398470")
01795         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][53]["Id"], "15268859")
01796         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][53]["Score"], "37340582")
01797         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][54]["Id"], "12235289")
01798         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][54]["Score"], "37247450")
01799         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][55]["Id"], "16741559")
01800         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][55]["Score"], "37198716")
01801         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][56]["Id"], "11266451")
01802         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][56]["Score"], "37142542")
01803         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][57]["Id"], "15075237")
01804         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][57]["Score"], "36897578")
01805         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][58]["Id"], "15485811")
01806         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][58]["Score"], "36804297")
01807         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][59]["Id"], "14699129")
01808         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][59]["Score"], "36782062")
01809         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][60]["Id"], "16510521")
01810         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][60]["Score"], "36724370")
01811         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][61]["Id"], "15824131")
01812         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][61]["Score"], "36695341")
01813         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][62]["Id"], "15371340")
01814         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][62]["Score"], "36685694")
01815         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][63]["Id"], "9878245")
01816         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][63]["Score"], "36684230")
01817         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][64]["Id"], "10398680")
01818         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][64]["Score"], "36573411")
01819         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][65]["Id"], "16516834")
01820         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][65]["Score"], "36525654")
01821         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][66]["Id"], "11715021")
01822         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][66]["Score"], "36518129")
01823         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][67]["Id"], "14622138")
01824         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][67]["Score"], "36496009")
01825         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][68]["Id"], "11092768")
01826         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][68]["Score"], "36457186")
01827         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][69]["Id"], "12514103")
01828         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][69]["Score"], "36385909")
01829         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][70]["Id"], "17525528")
01830         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][70]["Score"], "36316439")
01831         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][71]["Id"], "11402064")
01832         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][71]["Score"], "36172957")
01833         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][72]["Id"], "9258677")
01834         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][72]["Score"], "35989143")
01835         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][73]["Id"], "14499625")
01836         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][73]["Score"], "35978627")
01837         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][74]["Id"], "10428958")
01838         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][74]["Score"], "35924800")
01839         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][75]["Id"], "14972679")
01840         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][75]["Score"], "35915578")
01841         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][76]["Id"], "9396743")
01842         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][76]["Score"], "35883749")
01843         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][77]["Id"], "16219694")
01844         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][77]["Score"], "35870689")
01845         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][78]["Id"], "11369198")
01846         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][78]["Score"], "35838048")
01847         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][79]["Id"], "17333235")
01848         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][79]["Score"], "35815282")
01849         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][80]["Id"], "11102811")
01850         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][80]["Score"], "35783566")
01851         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][81]["Id"], "10207147")
01852         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][81]["Score"], "35594009")
01853         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][82]["Id"], "10477755")
01854         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][82]["Score"], "35589601")
01855         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][83]["Id"], "10747094")
01856         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][83]["Score"], "35548072")
01857         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][84]["Id"], "15215209")
01858         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][84]["Score"], "35526869")
01859         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][85]["Id"], "11157774")
01860         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][85]["Score"], "35510607")
01861         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][86]["Id"], "10669599")
01862         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][86]["Score"], "35462246")
01863         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][87]["Id"], "17448445")
01864         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][87]["Score"], "35398470")
01865         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][88]["Id"], "17878237")
01866         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][88]["Score"], "35231311")
01867         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][89]["Id"], "10411903")
01868         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][89]["Score"], "35202708")
01869         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][90]["Id"], "12773390")
01870         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][90]["Score"], "35171743")
01871         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][91]["Id"], "12498686")
01872         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][91]["Score"], "35131906")
01873         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][92]["Id"], "9009204")
01874         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][92]["Score"], "34993776")
01875         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][93]["Id"], "17576797")
01876         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][93]["Score"], "34988639")
01877         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][94]["Id"], "10225945")
01878         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][94]["Score"], "34950419")
01879         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][95]["Id"], "11161560")
01880         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][95]["Score"], "34912466")
01881         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][96]["Id"], "11967147")
01882         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][96]["Score"], "34900540")
01883         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][97]["Id"], "14711415")
01884         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][97]["Score"], "34883714")
01885         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][98]["Id"], "2211824")
01886         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][98]["Score"], "34843507")
01887         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][99]["Id"], "15737064")
01888         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][99]["Score"], "34828187")
01889         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][100]["Id"], "7720068")
01890         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][100]["Score"], "34811182")
01891         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][101]["Id"], "9472001")
01892         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][101]["Score"], "34799321")
01893         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][102]["Id"], "11792803")
01894         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][102]["Score"], "34697393")
01895         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][103]["Id"], "11386760")
01896         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][103]["Score"], "34684610")
01897         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][104]["Id"], "15094189")
01898         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][104]["Score"], "34684021")
01899         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][105]["Id"], "9763420")
01900         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][105]["Score"], "34666950")
01901         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][106]["Id"], "10629219")
01902         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][106]["Score"], "34422925")
01903         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][107]["Id"], "11238410")
01904         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][107]["Score"], "34318521")
01905         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][108]["Id"], "17199038")
01906         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][108]["Score"], "34255594")
01907         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][109]["Id"], "12944469")
01908         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][109]["Score"], "34249507")
01909         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][110]["Id"], "15616192")
01910         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][110]["Score"], "34110517")
01911         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][111]["Id"], "11146660")
01912         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][111]["Score"], "34063257")
01913         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][112]["Id"], "11402066")
01914         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][112]["Score"], "34012520")
01915         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][113]["Id"], "6791901")
01916         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][113]["Score"], "33311119")
01917         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][114]["Id"], "7172865")
01918         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][114]["Score"], "32934223")
01919         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][115]["Id"], "8270646")
01920         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][115]["Score"], "32898701")
01921         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][116]["Id"], "1916263")
01922         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][116]["Score"], "32707765")
01923         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][117]["Id"], "7588080")
01924         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][117]["Score"], "32503526")
01925         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][118]["Id"], "7391142")
01926         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][118]["Score"], "31632645")
01927         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][119]["Id"], "6793236")
01928         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][119]["Score"], "31522175")
01929         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][120]["Id"], "2512302")
01930         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][120]["Score"], "30339372")
01931         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][121]["Id"], "7720069")
01932         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][121]["Score"], "30024525")
01933         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][122]["Id"], "8257792")
01934         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][122]["Score"], "29834355")
01935         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][123]["Id"], "3417141")
01936         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][123]["Score"], "27920818")
01937         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][124]["Id"], "3315496")
01938         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][124]["Score"], "27422009")
01939         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][125]["Id"], "1993311")
01940         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][125]["Score"], "26763828")
01941         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][126]["Id"], "6185450")
01942         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][126]["Score"], "26100420")
01943         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][127]["Id"], "1819515")
01944         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][127]["Score"], "26036804")
01945         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][128]["Id"], "7250964")
01946         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][128]["Score"], "25738652")
01947         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][129]["Id"], "8489280")
01948         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][129]["Score"], "25587858")
01949         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][130]["Id"], "7096444")
01950         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][130]["Score"], "24642544")
01951         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][131]["Id"], "348629")
01952         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][131]["Score"], "24432498")
01953         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][132]["Id"], "2275018")
01954         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][132]["Score"], "23077593")
01955         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][133]["Id"], "1747872")
01956         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][133]["Score"], "22933494")
01957         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][134]["Id"], "3547036")
01958         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][134]["Score"], "22925639")
01959         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][135]["Id"], "18291669")
01960         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][135]["Score"], "22762310")
01961         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][136]["Id"], "1576878")
01962         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][136]["Score"], "20846041")
01963         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][137]["Id"], "6230555")
01964         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][137]["Score"], "19354488")
01965         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][138]["Id"], "7627547")
01966         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][138]["Score"], "18940607")
01967         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][139]["Id"], "17678444")
01968         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][139]["Score"], "18834135")
01969         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][140]["Id"], "3366468")
01970         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][140]["Score"], "14831756")
01971         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][141]["Id"], "1959920")
01972         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][141]["Score"], "14156414")
01973         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][142]["Id"], "13242628")
01974         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][142]["Score"], "12584732")
01975         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][143]["Id"], "17248312")
01976         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][143]["Score"], "7610436")
01977 
01978     def test_nucleotide(self):
01979         '''Test parsing Nucleotide to Protein links returned by ELink
01980         '''
01981         # Retrieve IDs from Nucleotide for GI  48819, 7140345 to Protein
01982         # To create the XML file, use
01983         # >>> Bio.Entrez.elink(dbfrom="nucleotide", db="protein",
01984         #                      id="48819,7140345")
01985         handle = open('Entrez/elink2.xml', "rb")
01986         record = Entrez.read(handle)
01987         handle.close()
01988         self.assertEqual(record[0]["DbFrom"], "nucleotide")
01989         self.assertEqual(record[0]["IdList"], ["48819", "7140345"])
01990 
01991     def test_pubmed2(self):
01992         '''Test parsing pubmed links returned by ELink (second test)
01993         '''
01994         # Retrieve PubMed related articles for PMIDs 11812492 11774222
01995         # with a publication date from 1995 to the present
01996         # To create the XML file, use
01997         # >>> Bio.Entrez.elink(dbfrom="pubmed", id="11812492,11774222",
01998         #                      db="pubmed", mindate="1995", datetype="pdat")
01999         handle = open('Entrez/elink3.xml', "rb")
02000         record = Entrez.read(handle)
02001         handle.close()
02002         self.assertEqual(len(record), 1)
02003         self.assertEqual(record[0]["DbFrom"], "pubmed")
02004         self.assertEqual(len(record[0]['IdList']), 2)
02005         self.assertEqual(record[0]['IdList'][0], "11812492")
02006         self.assertEqual(record[0]['IdList'][1], "11774222")
02007         self.assertEqual(record[0]["LinkSetDb"][0]["DbTo"], "pubmed")
02008         self.assertEqual(record[0]["LinkSetDb"][0]["LinkName"], "pubmed_pubmed")
02009         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][0]["Id"], "11812492")
02010         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][0]["Score"], "2147483647")
02011         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][1]["Id"], "11774222")
02012         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][1]["Score"], "2147483647")
02013         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][2]["Id"], "11668631")
02014         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][2]["Score"], "86345306")
02015         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][3]["Id"], "15111095")
02016         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][3]["Score"], "81604359")
02017         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][4]["Id"], "10731564")
02018         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][4]["Score"], "65665112")
02019         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][5]["Id"], "15780005")
02020         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][5]["Score"], "62251079")
02021         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][6]["Id"], "17885136")
02022         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][6]["Score"], "50322134")
02023         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][7]["Id"], "17470297")
02024         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][7]["Score"], "49148434")
02025         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][8]["Id"], "16005284")
02026         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][8]["Score"], "49035508")
02027         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][9]["Id"], "10856373")
02028         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][9]["Score"], "48363137")
02029         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][10]["Id"], "15383292")
02030         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][10]["Score"], "48347159")
02031         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][11]["Id"], "17040125")
02032         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][11]["Score"], "48301243")
02033         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][12]["Id"], "10770808")
02034         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][12]["Score"], "47696325")
02035         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][13]["Id"], "11125122")
02036         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][13]["Score"], "45889695")
02037         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][14]["Id"], "15287587")
02038         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][14]["Score"], "45599733")
02039         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][15]["Id"], "15839745")
02040         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][15]["Score"], "44650620")
02041         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][16]["Id"], "10612825")
02042         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][16]["Score"], "44445812")
02043         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][17]["Id"], "15024419")
02044         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][17]["Score"], "44075047")
02045         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][18]["Id"], "12743802")
02046         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][18]["Score"], "43873158")
02047         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][19]["Id"], "15238684")
02048         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][19]["Score"], "43856864")
02049         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][20]["Id"], "12386340")
02050         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][20]["Score"], "43770229")
02051         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][21]["Id"], "16269725")
02052         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][21]["Score"], "43712594")
02053         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][22]["Id"], "10592273")
02054         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][22]["Score"], "43640108")
02055         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][23]["Id"], "15383308")
02056         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][23]["Score"], "42835474")
02057         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][24]["Id"], "15676075")
02058         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][24]["Score"], "42272663")
02059         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][25]["Id"], "11774221")
02060         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][25]["Score"], "42058380")
02061         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][26]["Id"], "10592272")
02062         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][26]["Score"], "41719917")
02063         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][27]["Id"], "15997407")
02064         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][27]["Score"], "41535461")
02065         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][28]["Id"], "15774024")
02066         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][28]["Score"], "41351079")
02067         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][29]["Id"], "11233160")
02068         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][29]["Score"], "41268965")
02069         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][30]["Id"], "14702162")
02070         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][30]["Score"], "41147661")
02071         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][31]["Id"], "16616613")
02072         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][31]["Score"], "41073100")
02073         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][32]["Id"], "17202370")
02074         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][32]["Score"], "40819600")
02075         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][33]["Id"], "15478601")
02076         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][33]["Score"], "40578911")
02077         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][34]["Id"], "15322925")
02078         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][34]["Score"], "40548101")
02079         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][35]["Id"], "11472559")
02080         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][35]["Score"], "40508356")
02081         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][36]["Id"], "11925998")
02082         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][36]["Score"], "39844751")
02083         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][37]["Id"], "12372145")
02084         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][37]["Score"], "39809277")
02085         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][38]["Id"], "17562224")
02086         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][38]["Score"], "38850094")
02087         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][39]["Id"], "15037105")
02088         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][39]["Score"], "38758229")
02089         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][40]["Id"], "14998511")
02090         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][40]["Score"], "38608049")
02091         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][41]["Id"], "10092480")
02092         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][41]["Score"], "38410463")
02093         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][42]["Id"], "7729881")
02094         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][42]["Score"], "38329800")
02095         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][43]["Id"], "12933853")
02096         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][43]["Score"], "37881850")
02097         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][44]["Id"], "16818783")
02098         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][44]["Score"], "37835096")
02099         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][45]["Id"], "16406333")
02100         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][45]["Score"], "37775136")
02101         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][46]["Id"], "11472553")
02102         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][46]["Score"], "37750745")
02103         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][47]["Id"], "11403387")
02104         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][47]["Score"], "37707525")
02105         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][48]["Id"], "17306254")
02106         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][48]["Score"], "37685833")
02107         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][49]["Id"], "11516587")
02108         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][49]["Score"], "37620966")
02109         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][50]["Id"], "9274032")
02110         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][50]["Score"], "37528832")
02111         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][51]["Id"], "12856318")
02112         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][51]["Score"], "37484650")
02113         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][52]["Id"], "14695526")
02114         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][52]["Score"], "37429895")
02115         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][53]["Id"], "12481045")
02116         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][53]["Score"], "37051674")
02117         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][54]["Id"], "11752345")
02118         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][54]["Score"], "36875760")
02119         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][55]["Id"], "12467974")
02120         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][55]["Score"], "36787103")
02121         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][56]["Id"], "11214099")
02122         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][56]["Score"], "36710749")
02123         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][57]["Id"], "14638788")
02124         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][57]["Score"], "36667774")
02125         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][58]["Id"], "16278157")
02126         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][58]["Score"], "36598908")
02127         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][59]["Id"], "11752242")
02128         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][59]["Score"], "36555638")
02129         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][60]["Id"], "14681474")
02130         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][60]["Score"], "36317853")
02131         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][61]["Id"], "15944077")
02132         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][61]["Score"], "36264027")
02133         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][62]["Id"], "12625936")
02134         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][62]["Score"], "36088314")
02135         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][63]["Id"], "16672453")
02136         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][63]["Score"], "35985060")
02137         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][64]["Id"], "14695451")
02138         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][64]["Score"], "35971708")
02139         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][65]["Id"], "12402526")
02140         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][65]["Score"], "35942170")
02141         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][66]["Id"], "10592200")
02142         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][66]["Score"], "35932875")
02143         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][67]["Id"], "17584494")
02144         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][67]["Score"], "35869907")
02145         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][68]["Id"], "17761848")
02146         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][68]["Score"], "35868206")
02147         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][69]["Id"], "16697384")
02148         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][69]["Score"], "35792791")
02149         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][70]["Id"], "8784774")
02150         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][70]["Score"], "35787497")
02151         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][71]["Id"], "18000556")
02152         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][71]["Score"], "35701408")
02153         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][72]["Id"], "15828434")
02154         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][72]["Score"], "35604052")
02155         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][73]["Id"], "10511685")
02156         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][73]["Score"], "35598319")
02157         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][74]["Id"], "15608284")
02158         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][74]["Score"], "35439627")
02159         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][75]["Id"], "11125071")
02160         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][75]["Score"], "35414962")
02161         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][76]["Id"], "11791238")
02162         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][76]["Score"], "35411948")
02163         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][77]["Id"], "15710433")
02164         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][77]["Score"], "35197152")
02165         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][78]["Id"], "16164550")
02166         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][78]["Score"], "35172458")
02167         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][79]["Id"], "17697334")
02168         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][79]["Score"], "35121478")
02169         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][80]["Id"], "12537121")
02170         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][80]["Score"], "35054632")
02171         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][81]["Id"], "12860672")
02172         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][81]["Score"], "35046651")
02173         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][82]["Id"], "15630619")
02174         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][82]["Score"], "35034076")
02175         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][83]["Id"], "15125639")
02176         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][83]["Score"], "35007338")
02177         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][84]["Id"], "11443570")
02178         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][84]["Score"], "34935553")
02179         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][85]["Id"], "12208043")
02180         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][85]["Score"], "34923107")
02181         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][86]["Id"], "11731507")
02182         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][86]["Score"], "34875290")
02183         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][87]["Id"], "11988510")
02184         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][87]["Score"], "34773036")
02185         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][88]["Id"], "11125038")
02186         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][88]["Score"], "34754724")
02187         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][89]["Id"], "16381944")
02188         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][89]["Score"], "34747225")
02189         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][90]["Id"], "17135206")
02190         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][90]["Score"], "34735015")
02191         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][91]["Id"], "17099226")
02192         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][91]["Score"], "34698054")
02193         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][92]["Id"], "15608233")
02194         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][92]["Score"], "34588400")
02195         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][93]["Id"], "16672057")
02196         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][93]["Score"], "34583177")
02197         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][94]["Id"], "15687015")
02198         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][94]["Score"], "34357840")
02199         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][95]["Id"], "10782070")
02200         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][95]["Score"], "34326746")
02201         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][96]["Id"], "14970722")
02202         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][96]["Score"], "34217911")
02203         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][97]["Id"], "18027007")
02204         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][97]["Score"], "34185436")
02205         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][98]["Id"], "12387845")
02206         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][98]["Score"], "34083368")
02207         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][99]["Id"], "16237012")
02208         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][99]["Score"], "34070163")
02209         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][100]["Id"], "16351742")
02210         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][100]["Score"], "33775198")
02211         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][101]["Id"], "12203989")
02212         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][101]["Score"], "33759170")
02213         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][102]["Id"], "15474306")
02214         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][102]["Score"], "33737675")
02215         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][103]["Id"], "15270538")
02216         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][103]["Score"], "33697306")
02217         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][104]["Id"], "17518759")
02218         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][104]["Score"], "33695140")
02219         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][105]["Id"], "16085497")
02220         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][105]["Score"], "33652537")
02221         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][106]["Id"], "16423288")
02222         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][106]["Score"], "33564554")
02223         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][107]["Id"], "16251775")
02224         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][107]["Score"], "33547325")
02225         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][108]["Id"], "12632152")
02226         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][108]["Score"], "33497998")
02227         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][109]["Id"], "11269648")
02228         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][109]["Score"], "33493800")
02229         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][110]["Id"], "16103603")
02230         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][110]["Score"], "33378796")
02231         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][111]["Id"], "12816546")
02232         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][111]["Score"], "33316167")
02233         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][112]["Id"], "10221636")
02234         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][112]["Score"], "33310814")
02235         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][113]["Id"], "16381973")
02236         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][113]["Score"], "33236048")
02237         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][114]["Id"], "15977173")
02238         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][114]["Score"], "33222497")
02239         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][115]["Id"], "16351753")
02240         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][115]["Score"], "33205084")
02241         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][116]["Id"], "15317790")
02242         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][116]["Score"], "33195439")
02243         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][117]["Id"], "17135198")
02244         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][117]["Score"], "33189951")
02245         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][118]["Id"], "12701381")
02246         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][118]["Score"], "33172200")
02247         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][119]["Id"], "12203988")
02248         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][119]["Score"], "33172077")
02249         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][120]["Id"], "11456466")
02250         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][120]["Score"], "33124900")
02251         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][121]["Id"], "16936055")
02252         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][121]["Score"], "33081742")
02253         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][122]["Id"], "17183477")
02254         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][122]["Score"], "33005068")
02255         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][123]["Id"], "9455480")
02256         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][123]["Score"], "32997067")
02257         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][124]["Id"], "12490454")
02258         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][124]["Score"], "32995041")
02259         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][125]["Id"], "12435493")
02260         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][125]["Score"], "32990122")
02261         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][126]["Id"], "11038309")
02262         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][126]["Score"], "32977663")
02263         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][127]["Id"], "10366827")
02264         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][127]["Score"], "32903347")
02265         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][128]["Id"], "10466136")
02266         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][128]["Score"], "32869387")
02267         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][129]["Id"], "16381840")
02268         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][129]["Score"], "32816923")
02269         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][130]["Id"], "11825250")
02270         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][130]["Score"], "32776183")
02271         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][131]["Id"], "12234534")
02272         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][131]["Score"], "32708547")
02273         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][132]["Id"], "14624247")
02274         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][132]["Score"], "32708542")
02275         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][133]["Id"], "12886019")
02276         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][133]["Score"], "32653276")
02277         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][134]["Id"], "12041732")
02278         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][134]["Score"], "32607185")
02279         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][135]["Id"], "15336912")
02280         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][135]["Score"], "32596453")
02281         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][136]["Id"], "12652910")
02282         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][136]["Score"], "32567397")
02283         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][137]["Id"], "14681353")
02284         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][137]["Score"], "32549157")
02285         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][138]["Id"], "12586873")
02286         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][138]["Score"], "32504063")
02287         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][139]["Id"], "11481430")
02288         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][139]["Score"], "32462602")
02289         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][140]["Id"], "15254259")
02290         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][140]["Score"], "32441737")
02291         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][141]["Id"], "16873516")
02292         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][141]["Score"], "32433603")
02293         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][142]["Id"], "17170002")
02294         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][142]["Score"], "32425626")
02295         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][143]["Id"], "12519941")
02296         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][143]["Score"], "32367760")
02297         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][144]["Id"], "11197770")
02298         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][144]["Score"], "32362623")
02299         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][145]["Id"], "11240843")
02300         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][145]["Score"], "32347064")
02301         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][146]["Id"], "11328780")
02302         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][146]["Score"], "32333807")
02303         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][147]["Id"], "11875041")
02304         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][147]["Score"], "32312036")
02305         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][148]["Id"], "11752243")
02306         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][148]["Score"], "32268199")
02307         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][149]["Id"], "16907992")
02308         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][149]["Score"], "32247019")
02309         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][150]["Id"], "15046636")
02310         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][150]["Score"], "32214942")
02311         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][151]["Id"], "10592169")
02312         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][151]["Score"], "32137798")
02313         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][152]["Id"], "17919582")
02314         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][152]["Score"], "32137767")
02315         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][153]["Id"], "18025705")
02316         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][153]["Score"], "32131322")
02317         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][154]["Id"], "11029673")
02318         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][154]["Score"], "32126363")
02319         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][155]["Id"], "9047337")
02320         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][155]["Score"], "32090163")
02321         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][156]["Id"], "11080372")
02322         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][156]["Score"], "31924475")
02323         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][157]["Id"], "18045790")
02324         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][157]["Score"], "31834367")
02325         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][158]["Id"], "10215019")
02326         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][158]["Score"], "31823989")
02327         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][159]["Id"], "14706096")
02328         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][159]["Score"], "31781977")
02329         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][160]["Id"], "17537593")
02330         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][160]["Score"], "31771566")
02331         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][161]["Id"], "12819149")
02332         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][161]["Score"], "31683943")
02333         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][162]["Id"], "17880721")
02334         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][162]["Score"], "31630816")
02335         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][163]["Id"], "14681478")
02336         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][163]["Score"], "31620457")
02337         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][164]["Id"], "11985867")
02338         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][164]["Score"], "31544318")
02339         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][165]["Id"], "15608248")
02340         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][165]["Score"], "31542256")
02341         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][166]["Id"], "17401150")
02342         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][166]["Score"], "31497289")
02343         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][167]["Id"], "10359795")
02344         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][167]["Score"], "31460779")
02345         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][168]["Id"], "15608286")
02346         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][168]["Score"], "31435112")
02347         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][169]["Id"], "15774022")
02348         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][169]["Score"], "31425851")
02349         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][170]["Id"], "9921679")
02350         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][170]["Score"], "31396086")
02351         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][171]["Id"], "17038195")
02352         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][171]["Score"], "31380822")
02353         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][172]["Id"], "15491544")
02354         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][172]["Score"], "31294370")
02355         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][173]["Id"], "10469257")
02356         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][173]["Score"], "31291548")
02357         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][174]["Id"], "15487498")
02358         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][174]["Score"], "31268351")
02359         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][175]["Id"], "15383303")
02360         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][175]["Score"], "31264596")
02361         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][176]["Id"], "15643605")
02362         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][176]["Score"], "31259953")
02363         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][177]["Id"], "16418238")
02364         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][177]["Score"], "31259003")
02365         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][178]["Id"], "15500248")
02366         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][178]["Score"], "31252080")
02367         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][179]["Id"], "15479945")
02368         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][179]["Score"], "31249988")
02369         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][180]["Id"], "16962738")
02370         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][180]["Score"], "31249405")
02371         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][181]["Id"], "15094394")
02372         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][181]["Score"], "31200337")
02373         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][182]["Id"], "11758285")
02374         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][182]["Score"], "31180435")
02375         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][183]["Id"], "15723693")
02376         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][183]["Score"], "31083464")
02377         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][184]["Id"], "16710453")
02378         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][184]["Score"], "31083136")
02379         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][185]["Id"], "15311460")
02380         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][185]["Score"], "31068402")
02381         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][186]["Id"], "16549670")
02382         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][186]["Score"], "30995148")
02383         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][187]["Id"], "18180957")
02384         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][187]["Score"], "30973190")
02385         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][188]["Id"], "14681351")
02386         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][188]["Score"], "30968930")
02387         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][189]["Id"], "10902212")
02388         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][189]["Score"], "30960861")
02389         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][190]["Id"], "15357877")
02390         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][190]["Score"], "30947680")
02391         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][191]["Id"], "12356773")
02392         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][191]["Score"], "30910321")
02393         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][192]["Id"], "17537669")
02394         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][192]["Score"], "30893205")
02395         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][193]["Id"], "16551372")
02396         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][193]["Score"], "30889080")
02397         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][194]["Id"], "15231810")
02398         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][194]["Score"], "30863616")
02399         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][195]["Id"], "12819150")
02400         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][195]["Score"], "30847027")
02401         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][196]["Id"], "15608257")
02402         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][196]["Score"], "30840234")
02403         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][197]["Id"], "17384426")
02404         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][197]["Score"], "30827754")
02405         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][198]["Id"], "15811532")
02406         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][198]["Score"], "30823185")
02407         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][199]["Id"], "10612821")
02408         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][199]["Score"], "30822187")
02409         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][200]["Id"], "17062145")
02410         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][200]["Score"], "30813605")
02411         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][201]["Id"], "11355885")
02412         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][201]["Score"], "30810648")
02413         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][202]["Id"], "15746365")
02414         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][202]["Score"], "30784209")
02415         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][203]["Id"], "16282300")
02416         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][203]["Score"], "30782807")
02417         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][204]["Id"], "15546336")
02418         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][204]["Score"], "30773578")
02419         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][205]["Id"], "11741630")
02420         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][205]["Score"], "30764995")
02421         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][206]["Id"], "15980532")
02422         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][206]["Score"], "30735790")
02423         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][207]["Id"], "12519977")
02424         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][207]["Score"], "30707395")
02425         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][208]["Id"], "12436197")
02426         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][208]["Score"], "30705501")
02427         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][209]["Id"], "11125059")
02428         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][209]["Score"], "30614888")
02429         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][210]["Id"], "11163442")
02430         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][210]["Score"], "30550965")
02431         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][211]["Id"], "12519964")
02432         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][211]["Score"], "30518025")
02433         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][212]["Id"], "12083398")
02434         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][212]["Score"], "30466595")
02435         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][213]["Id"], "11908756")
02436         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][213]["Score"], "30462080")
02437         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][214]["Id"], "15608226")
02438         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][214]["Score"], "30335152")
02439         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][215]["Id"], "16845091")
02440         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][215]["Score"], "30277120")
02441         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][216]["Id"], "17338820")
02442         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][216]["Score"], "30208452")
02443         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][217]["Id"], "10407783")
02444         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][217]["Score"], "30171504")
02445         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][218]["Id"], "17130148")
02446         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][218]["Score"], "30160136")
02447         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][219]["Id"], "14681471")
02448         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][219]["Score"], "30155757")
02449         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][220]["Id"], "17445272")
02450         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][220]["Score"], "30015229")
02451         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][221]["Id"], "11279516")
02452         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][221]["Score"], "29947199")
02453         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][222]["Id"], "17221864")
02454         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][222]["Score"], "29893674")
02455         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][223]["Id"], "15827081")
02456         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][223]["Score"], "29891924")
02457         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][224]["Id"], "11222582")
02458         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][224]["Score"], "29878915")
02459         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][225]["Id"], "11384164")
02460         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][225]["Score"], "29871698")
02461         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][226]["Id"], "17877839")
02462         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][226]["Score"], "29843765")
02463         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][227]["Id"], "17151077")
02464         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][227]["Score"], "29841695")
02465         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][228]["Id"], "16381974")
02466         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][228]["Score"], "29740312")
02467         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][229]["Id"], "10592263")
02468         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][229]["Score"], "29633946")
02469         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][230]["Id"], "15608212")
02470         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][230]["Score"], "29621479")
02471         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][231]["Id"], "9847217")
02472         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][231]["Score"], "29618439")
02473         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][232]["Id"], "17142236")
02474         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][232]["Score"], "29577611")
02475         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][233]["Id"], "17059604")
02476         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][233]["Score"], "29569767")
02477         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][234]["Id"], "16845079")
02478         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][234]["Score"], "29506663")
02479         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][235]["Id"], "14727153")
02480         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][235]["Score"], "29368276")
02481         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][236]["Id"], "18045498")
02482         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][236]["Score"], "29364312")
02483         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][237]["Id"], "17185755")
02484         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][237]["Score"], "29331905")
02485         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][238]["Id"], "18025704")
02486         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][238]["Score"], "29323161")
02487         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][239]["Id"], "15215374")
02488         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][239]["Score"], "29306559")
02489         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][240]["Id"], "17135185")
02490         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][240]["Score"], "29236297")
02491         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][241]["Id"], "10466135")
02492         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][241]["Score"], "29231855")
02493         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][242]["Id"], "17148475")
02494         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][242]["Score"], "29229044")
02495         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][243]["Id"], "15657101")
02496         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][243]["Score"], "29209567")
02497         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][244]["Id"], "14681490")
02498         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][244]["Score"], "29189708")
02499         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][245]["Id"], "15714328")
02500         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][245]["Score"], "29183488")
02501         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][246]["Id"], "14960477")
02502         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][246]["Score"], "29040531")
02503         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][247]["Id"], "11015564")
02504         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][247]["Score"], "29011368")
02505         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][248]["Id"], "18064491")
02506         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][248]["Score"], "28956740")
02507         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][249]["Id"], "12734009")
02508         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][249]["Score"], "28950064")
02509         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][250]["Id"], "17094804")
02510         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][250]["Score"], "28906953")
02511         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][251]["Id"], "17908294")
02512         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][251]["Score"], "28897717")
02513         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][252]["Id"], "16176584")
02514         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][252]["Score"], "28874470")
02515         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][253]["Id"], "14715089")
02516         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][253]["Score"], "28763886")
02517         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][254]["Id"], "14681408")
02518         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][254]["Score"], "28697827")
02519         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][255]["Id"], "14594716")
02520         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][255]["Score"], "28686075")
02521         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][256]["Id"], "16528802")
02522         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][256]["Score"], "28644452")
02523         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][257]["Id"], "16010002")
02524         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][257]["Score"], "28637570")
02525         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][258]["Id"], "17430565")
02526         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][258]["Score"], "28635513")
02527         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][259]["Id"], "16452787")
02528         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][259]["Score"], "28631832")
02529         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][260]["Id"], "11197127")
02530         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][260]["Score"], "28619225")
02531         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][261]["Id"], "8682188")
02532         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][261]["Score"], "28592521")
02533         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][262]["Id"], "12519940")
02534         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][262]["Score"], "28573991")
02535         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][263]["Id"], "17121775")
02536         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][263]["Score"], "28448726")
02537         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][264]["Id"], "16371163")
02538         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][264]["Score"], "28373394")
02539         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][265]["Id"], "15300845")
02540         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][265]["Score"], "28338477")
02541         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][266]["Id"], "15248903")
02542         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][266]["Score"], "28323328")
02543         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][267]["Id"], "11319266")
02544         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][267]["Score"], "28293166")
02545         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][268]["Id"], "16336665")
02546         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][268]["Score"], "28231249")
02547         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][269]["Id"], "14681350")
02548         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][269]["Score"], "28227327")
02549         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][270]["Id"], "16216831")
02550         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][270]["Score"], "28224610")
02551         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][271]["Id"], "15494741")
02552         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][271]["Score"], "28190925")
02553         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][272]["Id"], "17088289")
02554         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][272]["Score"], "28168901")
02555         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][273]["Id"], "17099235")
02556         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][273]["Score"], "28159766")
02557         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][274]["Id"], "15215372")
02558         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][274]["Score"], "28129693")
02559         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][275]["Id"], "9169870")
02560         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][275]["Score"], "28117392")
02561         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][276]["Id"], "10077537")
02562         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][276]["Score"], "27911205")
02563         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][277]["Id"], "18172929")
02564         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][277]["Score"], "27885172")
02565         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][278]["Id"], "9571806")
02566         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][278]["Score"], "27841468")
02567         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][279]["Id"], "11752280")
02568         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][279]["Score"], "27795833")
02569         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][280]["Id"], "11414208")
02570         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][280]["Score"], "27725996")
02571         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][281]["Id"], "9298642")
02572         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][281]["Score"], "27716027")
02573         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][282]["Id"], "18073380")
02574         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][282]["Score"], "27437383")
02575         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][283]["Id"], "14527308")
02576         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][283]["Score"], "27332641")
02577         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][284]["Id"], "9847220")
02578         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][284]["Score"], "27083894")
02579         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][285]["Id"], "10413661")
02580         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][285]["Score"], "27073030")
02581         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][286]["Id"], "10407677")
02582         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][286]["Score"], "26907635")
02583         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][287]["Id"], "11244060")
02584         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][287]["Score"], "26897688")
02585         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][288]["Id"], "10227170")
02586         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][288]["Score"], "26766431")
02587         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][289]["Id"], "8719164")
02588         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][289]["Score"], "26515360")
02589         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][290]["Id"], "18359019")
02590         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][290]["Score"], "26225983")
02591         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][291]["Id"], "10511680")
02592         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][291]["Score"], "26031196")
02593         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][292]["Id"], "9884329")
02594         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][292]["Score"], "25992564")
02595         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][293]["Id"], "17827295")
02596         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][293]["Score"], "25989152")
02597         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][294]["Id"], "10899154")
02598         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][294]["Score"], "25843128")
02599         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][295]["Id"], "11668619")
02600         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][295]["Score"], "25822950")
02601         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][296]["Id"], "18386064")
02602         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][296]["Score"], "25702942")
02603         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][297]["Id"], "11092731")
02604         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][297]["Score"], "25618899")
02605         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][298]["Id"], "9520376")
02606         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][298]["Score"], "25549761")
02607         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][299]["Id"], "11756688")
02608         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][299]["Score"], "25440634")
02609         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][300]["Id"], "10737802")
02610         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][300]["Score"], "25362744")
02611         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][301]["Id"], "9879937")
02612         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][301]["Score"], "25277089")
02613         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][302]["Id"], "17822801")
02614         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][302]["Score"], "25252984")
02615         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][303]["Id"], "10965872")
02616         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][303]["Score"], "25208185")
02617         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][304]["Id"], "10511682")
02618         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][304]["Score"], "25183443")
02619         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][305]["Id"], "10851186")
02620         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][305]["Score"], "25092764")
02621         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][306]["Id"], "9775388")
02622         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][306]["Score"], "25026910")
02623         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][307]["Id"], "10810023")
02624         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][307]["Score"], "24904718")
02625         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][308]["Id"], "18032438")
02626         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][308]["Score"], "24509777")
02627         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][309]["Id"], "18377816")
02628         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][309]["Score"], "24373788")
02629         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][310]["Id"], "11774190")
02630         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][310]["Score"], "24185658")
02631         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][311]["Id"], "10484179")
02632         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][311]["Score"], "24122767")
02633         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][312]["Id"], "9625791")
02634         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][312]["Score"], "24049917")
02635         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][313]["Id"], "11446511")
02636         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][313]["Score"], "24048253")
02637         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][314]["Id"], "10066467")
02638         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][314]["Score"], "23968405")
02639         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][315]["Id"], "11783003")
02640         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][315]["Score"], "23393870")
02641         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][316]["Id"], "10611059")
02642         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][316]["Score"], "23255298")
02643         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][317]["Id"], "10587943")
02644         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][317]["Score"], "23014503")
02645         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][318]["Id"], "10612820")
02646         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][318]["Score"], "22990878")
02647         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][319]["Id"], "9685316")
02648         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][319]["Score"], "22771348")
02649         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][320]["Id"], "11125121")
02650         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][320]["Score"], "22732820")
02651         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][321]["Id"], "10075567")
02652         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][321]["Score"], "22670427")
02653         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][322]["Id"], "11084929")
02654         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][322]["Score"], "22397665")
02655         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][323]["Id"], "11357826")
02656         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][323]["Score"], "22362882")
02657         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][324]["Id"], "17983575")
02658         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][324]["Score"], "22305320")
02659         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][325]["Id"], "11038308")
02660         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][325]["Score"], "22115670")
02661         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][326]["Id"], "18257289")
02662         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][326]["Score"], "22053176")
02663         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][327]["Id"], "10419978")
02664         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][327]["Score"], "22016184")
02665         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][328]["Id"], "9421619")
02666         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][328]["Score"], "21957407")
02667         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][329]["Id"], "10592198")
02668         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][329]["Score"], "21803908")
02669         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][330]["Id"], "11483982")
02670         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][330]["Score"], "20783817")
02671         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][331]["Id"], "11329386")
02672         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][331]["Score"], "20223493")
02673         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][332]["Id"], "10587942")
02674         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][332]["Score"], "20208799")
02675         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][333]["Id"], "10810024")
02676         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][333]["Score"], "19989188")
02677         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][334]["Id"], "11480780")
02678         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][334]["Score"], "19974101")
02679         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][335]["Id"], "11802378")
02680         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][335]["Score"], "19738532")
02681         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][336]["Id"], "10610803")
02682         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][336]["Score"], "19359100")
02683         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][337]["Id"], "10407668")
02684         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][337]["Score"], "19070525")
02685         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][338]["Id"], "18287701")
02686         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][338]["Score"], "19065945")
02687         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][339]["Id"], "10963611")
02688         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][339]["Score"], "18962273")
02689         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][340]["Id"], "10447503")
02690         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][340]["Score"], "17406980")
02691         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][341]["Id"], "9830540")
02692         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][341]["Score"], "17143709")
02693         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][342]["Id"], "11462837")
02694         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][342]["Score"], "16819799")
02695         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][343]["Id"], "10637631")
02696         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][343]["Score"], "16390796")
02697         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][344]["Id"], "11387032")
02698         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][344]["Score"], "15698695")
02699         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][345]["Id"], "18365535")
02700         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][345]["Score"], "15494816")
02701         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][346]["Id"], "15181901")
02702         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][346]["Score"], "14385628")
02703 
02704     def test_medline(self):
02705         '''Test parsing medline indexed articles returned by ELink
02706         '''
02707         # Retrieve MEDLINE indexed only related articles for PMID 12242737
02708         # To create the XML file, use
02709         # >>> Bio.Entrez.elink(dbfrom="pubmed", id="12242737", db="pubmed",
02710         #                      term="medline[sb]")
02711         handle = open('Entrez/elink4.xml', "rb")
02712         record = Entrez.read(handle)
02713         handle.close()
02714         self.assertEqual(len(record), 1)
02715         self.assertEqual(record[0]["DbFrom"], "pubmed")
02716         self.assertEqual(record[0]["IdList"], ["12242737"])
02717         self.assertEqual(record[0]["LinkSetDb"][0]["DbTo"], "pubmed")
02718         self.assertEqual(record[0]["LinkSetDb"][0]["LinkName"], "pubmed_pubmed")
02719         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][0]["Id"], "12242737")
02720         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][0]["Score"], "2147483647")
02721         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][1]["Id"], "11218011")
02722         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][1]["Score"], "50825961")
02723         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][2]["Id"], "11329656")
02724         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][2]["Score"], "49822043")
02725         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][3]["Id"], "9757294")
02726         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][3]["Score"], "42645380")
02727         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][4]["Id"], "9456947")
02728         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][4]["Score"], "39871666")
02729         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][5]["Id"], "17193860")
02730         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][5]["Score"], "39717388")
02731         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][6]["Id"], "11274884")
02732         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][6]["Score"], "39233276")
02733         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][7]["Id"], "12878072")
02734         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][7]["Score"], "37748327")
02735         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][8]["Id"], "11125632")
02736         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][8]["Score"], "36227857")
02737         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][9]["Id"], "12822521")
02738         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][9]["Score"], "36170366")
02739         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][10]["Id"], "16999328")
02740         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][10]["Score"], "36107139")
02741         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][11]["Id"], "17875142")
02742         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][11]["Score"], "35736802")
02743         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][12]["Id"], "9510579")
02744         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][12]["Score"], "35206779")
02745         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][13]["Id"], "17354190")
02746         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][13]["Score"], "34792954")
02747         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][14]["Id"], "11702119")
02748         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][14]["Score"], "34618984")
02749         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][15]["Id"], "10024396")
02750         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][15]["Score"], "33877753")
02751         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][16]["Id"], "14650118")
02752         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][16]["Score"], "33746160")
02753         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][17]["Id"], "17243036")
02754         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][17]["Score"], "33198930")
02755         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][18]["Id"], "16580806")
02756         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][18]["Score"], "33117197")
02757         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][19]["Id"], "15278705")
02758         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][19]["Score"], "33002826")
02759         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][20]["Id"], "15236131")
02760         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][20]["Score"], "32808406")
02761         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][21]["Id"], "11368937")
02762         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][21]["Score"], "32277701")
02763         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][22]["Id"], "10688065")
02764         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][22]["Score"], "32052850")
02765         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][23]["Id"], "15635471")
02766         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][23]["Score"], "31938251")
02767         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][24]["Id"], "16357381")
02768         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][24]["Score"], "31780147")
02769         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][25]["Id"], "8153333")
02770         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][25]["Score"], "31542202")
02771         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][26]["Id"], "16284132")
02772         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][26]["Score"], "31290577")
02773         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][27]["Id"], "11329162")
02774         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][27]["Score"], "31163088")
02775         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][28]["Id"], "11973040")
02776         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][28]["Score"], "31156707")
02777         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][29]["Id"], "15143223")
02778         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][29]["Score"], "31025329")
02779         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][30]["Id"], "17040637")
02780         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][30]["Score"], "30990506")
02781         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][31]["Id"], "11016058")
02782         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][31]["Score"], "30966482")
02783         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][32]["Id"], "9317094")
02784         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][32]["Score"], "30935529")
02785         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][33]["Id"], "16133609")
02786         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][33]["Score"], "30580027")
02787         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][34]["Id"], "17325998")
02788         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][34]["Score"], "30130533")
02789         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][35]["Id"], "15505294")
02790         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][35]["Score"], "29430378")
02791         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][36]["Id"], "17268692")
02792         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][36]["Score"], "29166153")
02793         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][37]["Id"], "11329655")
02794         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][37]["Score"], "29112282")
02795         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][38]["Id"], "11775722")
02796         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][38]["Score"], "28940754")
02797         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][39]["Id"], "11907356")
02798         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][39]["Score"], "28860163")
02799         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][40]["Id"], "10222515")
02800         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][40]["Score"], "28807143")
02801         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][41]["Id"], "17174054")
02802         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][41]["Score"], "28790302")
02803         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][42]["Id"], "9314960")
02804         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][42]["Score"], "28750160")
02805         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][43]["Id"], "14661661")
02806         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][43]["Score"], "28361423")
02807         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][44]["Id"], "17879696")
02808         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][44]["Score"], "28120568")
02809         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][45]["Id"], "4818442")
02810         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][45]["Score"], "28058957")
02811         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][46]["Id"], "15141648")
02812         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][46]["Score"], "28011681")
02813         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][47]["Id"], "8855688")
02814         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][47]["Score"], "27711822")
02815         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][48]["Id"], "17875143")
02816         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][48]["Score"], "27711025")
02817         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][49]["Id"], "1481295")
02818         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][49]["Score"], "27707751")
02819         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][50]["Id"], "8599783")
02820         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][50]["Score"], "27683273")
02821         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][51]["Id"], "10499696")
02822         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][51]["Score"], "27623848")
02823         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][52]["Id"], "12733684")
02824         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][52]["Score"], "27527242")
02825         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][53]["Id"], "18021675")
02826         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][53]["Score"], "27495074")
02827         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][54]["Id"], "12226761")
02828         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][54]["Score"], "27366064")
02829         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][55]["Id"], "4808999")
02830         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][55]["Score"], "27304472")
02831         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][56]["Id"], "16988291")
02832         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][56]["Score"], "27295295")
02833         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][57]["Id"], "10575758")
02834         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][57]["Score"], "27243181")
02835         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][58]["Id"], "8903064")
02836         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][58]["Score"], "27206664")
02837         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][59]["Id"], "10811354")
02838         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][59]["Score"], "27088219")
02839         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][60]["Id"], "16096604")
02840         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][60]["Score"], "26862979")
02841         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][61]["Id"], "15788584")
02842         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][61]["Score"], "26759584")
02843         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][62]["Id"], "17376366")
02844         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][62]["Score"], "26743241")
02845         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][63]["Id"], "16566645")
02846         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][63]["Score"], "26725076")
02847         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][64]["Id"], "17259035")
02848         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][64]["Score"], "26595433")
02849         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][65]["Id"], "9314959")
02850         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][65]["Score"], "26445900")
02851         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][66]["Id"], "11895298")
02852         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][66]["Score"], "26256774")
02853         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][67]["Id"], "11740602")
02854         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][67]["Score"], "26158189")
02855         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][68]["Id"], "15022983")
02856         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][68]["Score"], "25889186")
02857         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][69]["Id"], "15300544")
02858         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][69]["Score"], "25837458")
02859         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][70]["Id"], "12719915")
02860         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][70]["Score"], "25831232")
02861         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][71]["Id"], "14661306")
02862         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][71]["Score"], "25788023")
02863         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][72]["Id"], "16362812")
02864         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][72]["Score"], "25565076")
02865         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][73]["Id"], "17320773")
02866         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][73]["Score"], "25504305")
02867         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][74]["Id"], "11762248")
02868         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][74]["Score"], "25504002")
02869         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][75]["Id"], "10665303")
02870         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][75]["Score"], "25384388")
02871         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][76]["Id"], "17453494")
02872         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][76]["Score"], "25226372")
02873         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][77]["Id"], "9575723")
02874         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][77]["Score"], "25174136")
02875         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][78]["Id"], "12744498")
02876         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][78]["Score"], "24971179")
02877         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][79]["Id"], "12352163")
02878         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][79]["Score"], "24915990")
02879         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][80]["Id"], "8290724")
02880         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][80]["Score"], "24909462")
02881         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][81]["Id"], "11973504")
02882         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][81]["Score"], "24878058")
02883         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][82]["Id"], "14661668")
02884         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][82]["Score"], "24779779")
02885         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][83]["Id"], "16552382")
02886         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][83]["Score"], "24760919")
02887         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][84]["Id"], "17709829")
02888         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][84]["Score"], "24743292")
02889         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][85]["Id"], "14528718")
02890         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][85]["Score"], "24686212")
02891         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][86]["Id"], "15008163")
02892         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][86]["Score"], "24612994")
02893         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][87]["Id"], "10051883")
02894         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][87]["Score"], "24492331")
02895         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][88]["Id"], "11027076")
02896         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][88]["Score"], "24410525")
02897         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][89]["Id"], "17543650")
02898         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][89]["Score"], "24371825")
02899         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][90]["Id"], "17658095")
02900         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][90]["Score"], "24331965")
02901         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][91]["Id"], "9193407")
02902         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][91]["Score"], "24240252")
02903         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][92]["Id"], "10578418")
02904         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][92]["Score"], "24091226")
02905         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][93]["Id"], "12592155")
02906         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][93]["Score"], "24001341")
02907         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][94]["Id"], "17157468")
02908         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][94]["Score"], "23984321")
02909         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][95]["Id"], "15094630")
02910         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][95]["Score"], "23912874")
02911         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][96]["Id"], "8794574")
02912         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][96]["Score"], "23900764")
02913         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][97]["Id"], "9125660")
02914         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][97]["Score"], "23884352")
02915         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][98]["Id"], "8819381")
02916         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][98]["Score"], "23839719")
02917         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][99]["Id"], "14661666")
02918         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][99]["Score"], "23748510")
02919         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][100]["Id"], "9658901")
02920         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][100]["Score"], "23667126")
02921         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][101]["Id"], "12744499")
02922         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][101]["Score"], "23647189")
02923         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][102]["Id"], "12164574")
02924         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][102]["Score"], "23623853")
02925         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][103]["Id"], "15136027")
02926         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][103]["Score"], "23572558")
02927         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][104]["Id"], "14872380")
02928         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][104]["Score"], "23460906")
02929         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][105]["Id"], "3905087")
02930         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][105]["Score"], "23305022")
02931         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][106]["Id"], "15642291")
02932         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][106]["Score"], "23234831")
02933         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][107]["Id"], "16928974")
02934         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][107]["Score"], "23223298")
02935         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][108]["Id"], "6072516")
02936         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][108]["Score"], "23042548")
02937         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][109]["Id"], "12949462")
02938         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][109]["Score"], "23001441")
02939         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][110]["Id"], "10761553")
02940         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][110]["Score"], "22995991")
02941         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][111]["Id"], "14661663")
02942         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][111]["Score"], "22986720")
02943         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][112]["Id"], "16338316")
02944         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][112]["Score"], "22933288")
02945         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][113]["Id"], "17464254")
02946         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][113]["Score"], "22912253")
02947         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][114]["Id"], "15529836")
02948         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][114]["Score"], "22892154")
02949         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][115]["Id"], "12361530")
02950         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][115]["Score"], "22871698")
02951         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][116]["Id"], "12876813")
02952         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][116]["Score"], "22822515")
02953         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][117]["Id"], "10749221")
02954         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][117]["Score"], "22794373")
02955         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][118]["Id"], "6482054")
02956         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][118]["Score"], "22791927")
02957         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][119]["Id"], "9016217")
02958         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][119]["Score"], "22738432")
02959         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][120]["Id"], "14702442")
02960         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][120]["Score"], "22722123")
02961         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][121]["Id"], "15279747")
02962         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][121]["Score"], "22698787")
02963         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][122]["Id"], "7892443")
02964         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][122]["Score"], "22642038")
02965         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][123]["Id"], "616459")
02966         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][123]["Score"], "22591277")
02967         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][124]["Id"], "8886718")
02968         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][124]["Score"], "22542938")
02969         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][125]["Id"], "17245521")
02970         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][125]["Score"], "22538649")
02971         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][126]["Id"], "1535863")
02972         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][126]["Score"], "22468774")
02973         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][127]["Id"], "15537403")
02974         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][127]["Score"], "22458002")
02975         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][128]["Id"], "16040910")
02976         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][128]["Score"], "22452119")
02977         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][129]["Id"], "16929028")
02978         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][129]["Score"], "22433988")
02979         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][130]["Id"], "16697589")
02980         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][130]["Score"], "22366606")
02981         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][131]["Id"], "531835")
02982         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][131]["Score"], "22366454")
02983         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][132]["Id"], "2308313")
02984         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][132]["Score"], "22330898")
02985         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][133]["Id"], "12522920")
02986         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][133]["Score"], "22178764")
02987         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][134]["Id"], "10222521")
02988         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][134]["Score"], "22135023")
02989         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][135]["Id"], "10499697")
02990         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][135]["Score"], "22130302")
02991         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][136]["Id"], "8903058")
02992         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][136]["Score"], "22113132")
02993         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][137]["Id"], "17441569")
02994         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][137]["Score"], "22085858")
02995         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][138]["Id"], "15284932")
02996         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][138]["Score"], "22075791")
02997         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][139]["Id"], "15466771")
02998         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][139]["Score"], "22075418")
02999         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][140]["Id"], "17145267")
03000         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][140]["Score"], "22033864")
03001         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][141]["Id"], "11329662")
03002         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][141]["Score"], "22012948")
03003         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][142]["Id"], "10222514")
03004         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][142]["Score"], "22009777")
03005         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][143]["Id"], "17383530")
03006         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][143]["Score"], "22003600")
03007         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][144]["Id"], "12455800")
03008         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][144]["Score"], "21992674")
03009         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][145]["Id"], "15845051")
03010         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][145]["Score"], "21946257")
03011         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][146]["Id"], "11443295")
03012         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][146]["Score"], "21908841")
03013         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][147]["Id"], "15162233")
03014         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][147]["Score"], "21903624")
03015         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][148]["Id"], "16133610")
03016         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][148]["Score"], "21872203")
03017         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][149]["Id"], "12845461")
03018         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][149]["Score"], "21864314")
03019         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][150]["Id"], "16947073")
03020         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][150]["Score"], "21832153")
03021         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][151]["Id"], "7415301")
03022         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][151]["Score"], "21822396")
03023         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][152]["Id"], "16416239")
03024         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][152]["Score"], "21820165")
03025         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][153]["Id"], "4848922")
03026         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][153]["Score"], "21786194")
03027         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][154]["Id"], "12720164")
03028         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][154]["Score"], "21785319")
03029         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][155]["Id"], "17093987")
03030         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][155]["Score"], "21750370")
03031         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][156]["Id"], "16769006")
03032         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][156]["Score"], "21735873")
03033         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][157]["Id"], "17954835")
03034         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][157]["Score"], "21733933")
03035         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][158]["Id"], "15236134")
03036         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][158]["Score"], "21640099")
03037         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][159]["Id"], "12524603")
03038         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][159]["Score"], "21636724")
03039         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][160]["Id"], "16749985")
03040         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][160]["Score"], "21628926")
03041         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][161]["Id"], "3213296")
03042         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][161]["Score"], "21490232")
03043         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][162]["Id"], "11409026")
03044         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][162]["Score"], "21061296")
03045         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][163]["Id"], "9725288")
03046         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][163]["Score"], "21053585")
03047         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][164]["Id"], "6217136")
03048         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][164]["Score"], "21042914")
03049         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][165]["Id"], "663071")
03050         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][165]["Score"], "20926141")
03051         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][166]["Id"], "10341802")
03052         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][166]["Score"], "20797282")
03053         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][167]["Id"], "6473764")
03054         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][167]["Score"], "20757680")
03055         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][168]["Id"], "2584497")
03056         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][168]["Score"], "20521350")
03057         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][169]["Id"], "8338105")
03058         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][169]["Score"], "20501334")
03059         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][170]["Id"], "18053822")
03060         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][170]["Score"], "20275078")
03061         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][171]["Id"], "4058411")
03062         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][171]["Score"], "20161667")
03063         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][172]["Id"], "11669077")
03064         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][172]["Score"], "19993282")
03065         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][173]["Id"], "11781922")
03066         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][173]["Score"], "19969425")
03067         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][174]["Id"], "9793138")
03068         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][174]["Score"], "19952972")
03069         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][175]["Id"], "9391495")
03070         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][175]["Score"], "19815538")
03071         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][176]["Id"], "10803203")
03072         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][176]["Score"], "19495693")
03073         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][177]["Id"], "7326186")
03074         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][177]["Score"], "19273989")
03075         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][178]["Id"], "11868066")
03076         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][178]["Score"], "19220137")
03077         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][179]["Id"], "10904988")
03078         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][179]["Score"], "19203510")
03079         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][180]["Id"], "3288780")
03080         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][180]["Score"], "18958114")
03081         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][181]["Id"], "2047316")
03082         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][181]["Score"], "18907473")
03083         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][182]["Id"], "12237004")
03084         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][182]["Score"], "18751474")
03085         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][183]["Id"], "5627987")
03086         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][183]["Score"], "18741903")
03087         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][184]["Id"], "9269670")
03088         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][184]["Score"], "18666426")
03089         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][185]["Id"], "8903059")
03090         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][185]["Score"], "18653874")
03091         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][186]["Id"], "5594242")
03092         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][186]["Score"], "18548780")
03093         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][187]["Id"], "7068417")
03094         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][187]["Score"], "18390022")
03095         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][188]["Id"], "7330196")
03096         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][188]["Score"], "18371587")
03097         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][189]["Id"], "7408592")
03098         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][189]["Score"], "18275541")
03099         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][190]["Id"], "8835983")
03100         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][190]["Score"], "18176923")
03101         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][191]["Id"], "6940010")
03102         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][191]["Score"], "18011066")
03103         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][192]["Id"], "10499712")
03104         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][192]["Score"], "17943586")
03105         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][193]["Id"], "4539876")
03106         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][193]["Score"], "17915154")
03107         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][194]["Id"], "1943587")
03108         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][194]["Score"], "17752606")
03109         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][195]["Id"], "9847909")
03110         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][195]["Score"], "17568386")
03111         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][196]["Id"], "11578071")
03112         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][196]["Score"], "17561413")
03113         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][197]["Id"], "11789473")
03114         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][197]["Score"], "17435433")
03115         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][198]["Id"], "9885599")
03116         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][198]["Score"], "17383598")
03117         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][199]["Id"], "7423836")
03118         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][199]["Score"], "17196872")
03119         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][200]["Id"], "10688063")
03120         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][200]["Score"], "16453112")
03121         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][201]["Id"], "11695100")
03122         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][201]["Score"], "16352760")
03123         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][202]["Id"], "11329658")
03124         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][202]["Score"], "16089885")
03125         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][203]["Id"], "11939665")
03126         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][203]["Score"], "15947974")
03127         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][204]["Id"], "5512349")
03128         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][204]["Score"], "15647685")
03129         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][205]["Id"], "2222794")
03130         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][205]["Score"], "14981157")
03131         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][206]["Id"], "5998281")
03132         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][206]["Score"], "14226588")
03133         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][207]["Id"], "10475937")
03134         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][207]["Score"], "13934390")
03135         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][208]["Id"], "5046513")
03136         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][208]["Score"], "12769605")
03137         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][209]["Id"], "1539132")
03138         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][209]["Score"], "12395064")
03139         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][210]["Id"], "4414214")
03140         self.assertEqual(record[0]["LinkSetDb"][0]["Link"][210]["Score"], "10113539")
03141 
03142     def test_pubmed3(self):
03143         '''Test parsing pubmed link returned by ELink (third test)
03144         '''
03145         # Create a hyperlink to the first link available for PMID 10611131
03146         # in PubMed
03147         # To create the XML file, use
03148         # >>> Bio.Entrez.elink(dbfrom="pubmed", id="10611131", cmd="prlinks")
03149 
03150         handle = open('Entrez/elink5.xml', "rb")
03151         record = Entrez.read(handle)
03152         handle.close()
03153         self.assertEqual(record[0]["DbFrom"], "pubmed")
03154         self.assertEqual(len(record[0]["IdUrlList"]), 1)
03155         self.assertEqual(len(record[0]["IdUrlList"][0]), 2)
03156         self.assertEqual(record[0]["IdUrlList"][0]["Id"], "10611131")
03157         self.assertEqual(len(record[0]["IdUrlList"][0]["ObjUrl"]), 1)
03158         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Url"], "http://brain.oxfordjournals.org/cgi/pmidlookup?view=long&pmid=10611131")
03159         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["IconUrl"], "http://www.ncbi.nlm.nih.gov/entrez/query/egifs/http:--highwire.stanford.edu-icons-externalservices-pubmed-custom-oxfordjournals_final_free.gif")
03160         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["SubjectType"], ["publishers/providers"])
03161         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Attribute"][0], "publisher of information in URL")
03162         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Attribute"][1], "full-text online")
03163         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Provider"]["Name"], "HighWire Press")
03164         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Provider"]["NameAbbr"], "HighWire")
03165         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Provider"]["Id"], "3051")
03166         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Provider"]["Url"], "http://highwire.stanford.edu")
03167         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Provider"]["IconUrl"], "http://highwire.stanford.edu/icons/externalservices/pubmed/highwirepress.jpg")
03168 
03169 
03170     def test_pubmed4(self):
03171         '''Test parsing pubmed links returned by ELink (fourth test)
03172         '''
03173         # List all available links in PubMed, except for libraries, for
03174         # PMIDs 12085856 and 12085853
03175         # To create the XML file, use
03176         # >>> Bio.Entrez.elink(dbfrom="pubmed", id="12085856,12085853", cmd="llinks")
03177         handle = open('Entrez/elink6.xml', "rb")
03178         record = Entrez.read(handle)
03179         handle.close()
03180         self.assertEqual(record[0]["DbFrom"], "pubmed")
03181         self.assertEqual(len(record[0]["IdUrlList"]), 2)
03182         self.assertEqual(record[0]["IdUrlList"][0]["Id"], "12085856")
03183         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Url"], "http://symptomresearch.nih.gov/chapter_1/index.htm")
03184         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["SubjectType"], ["online tutorials/courses"])
03185         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Provider"]["Name"], "New England Research Institutes Inc.")
03186         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Provider"]["NameAbbr"], "NERI")
03187         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Provider"]["Id"], "3291")
03188         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][0]["Provider"]["Url"], "http://www.symptomresearch.com")
03189         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][1]["Url"], "http://www.nlm.nih.gov/medlineplus/coronaryarterybypasssurgery.html")
03190         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][1]["IconUrl"], "http://www.ncbi.nlm.nih.gov/entrez/query/egifs/http:--www.nlm.nih.gov-medlineplus-images-linkout_sm.gif")
03191         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][1]["LinkName"], "Coronary Artery Bypass Surgery")
03192         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][1]["SubjectType"], ["consumer health"])
03193         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][1]["Provider"]["Name"], "MedlinePlus Health Information")
03194         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][1]["Provider"]["NameAbbr"], "MEDPLUS")
03195         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][1]["Provider"]["Id"], "3162")
03196         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][1]["Provider"]["Url"], "http://medlineplus.gov/")
03197         self.assertEqual(record[0]["IdUrlList"][0]["ObjUrl"][1]["Provider"]["IconUrl"], "http://www.nlm.nih.gov/medlineplus/images/linkout_sm.gif")
03198 
03199         self.assertEqual(record[0]["IdUrlList"][1]["Id"], "12085853")
03200         self.assertEqual(len(record[0]["IdUrlList"][1]["ObjUrl"]), 4)
03201         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][0]["Url"], "http://www.nlm.nih.gov/medlineplus/arrhythmia.html")
03202         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][0]["IconUrl"], "http://www.ncbi.nlm.nih.gov/entrez/query/egifs/http:--www.nlm.nih.gov-medlineplus-images-linkout_sm.gif")
03203         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][0]["LinkName"], "Arrhythmia")
03204         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][0]["SubjectType"], ["consumer health"])
03205         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][0]["Provider"]["Name"], "MedlinePlus Health Information")
03206         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][0]["Provider"]["NameAbbr"], "MEDPLUS")
03207         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][0]["Provider"]["Id"], "3162")
03208         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][0]["Provider"]["Url"], "http://medlineplus.gov/")
03209         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][0]["Provider"]["IconUrl"], "http://www.nlm.nih.gov/medlineplus/images/linkout_sm.gif")
03210         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][1]["Url"], "http://www.nlm.nih.gov/medlineplus/exerciseandphysicalfitness.html")
03211         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][1]["IconUrl"], "http://www.ncbi.nlm.nih.gov/entrez/query/egifs/http:--www.nlm.nih.gov-medlineplus-images-linkout_sm.gif")
03212         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][1]["LinkName"], "Exercise and Physical Fitness")
03213         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][1]["SubjectType"], ["consumer health"])
03214         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][1]["Provider"]["Name"], "MedlinePlus Health Information")
03215         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][1]["Provider"]["NameAbbr"], "MEDPLUS")
03216         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][1]["Provider"]["Id"], "3162")
03217         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][1]["Provider"]["Url"], "http://medlineplus.gov/")
03218         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][1]["Provider"]["IconUrl"], "http://www.nlm.nih.gov/medlineplus/images/linkout_sm.gif")
03219         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][2]["Url"], "http://www.nlm.nih.gov/medlineplus/exerciseforchildren.html")
03220         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][2]["IconUrl"], "http://www.ncbi.nlm.nih.gov/entrez/query/egifs/http:--www.nlm.nih.gov-medlineplus-images-linkout_sm.gif")
03221         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][2]["LinkName"], "Exercise for Children")
03222         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][2]["SubjectType"], ["consumer health"])
03223         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][2]["Provider"]["Name"], "MedlinePlus Health Information")
03224         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][2]["Provider"]["NameAbbr"], "MEDPLUS")
03225         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][2]["Provider"]["Id"], "3162")
03226         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][2]["Provider"]["Url"], "http://medlineplus.gov/")
03227         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][2]["Provider"]["IconUrl"], "http://www.nlm.nih.gov/medlineplus/images/linkout_sm.gif")
03228         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][3]["Url"], "http://www.nlm.nih.gov/medlineplus/pacemakersandimplantabledefibrillators.html")
03229         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][3]["IconUrl"], "http://www.ncbi.nlm.nih.gov/entrez/query/egifs/http:--www.nlm.nih.gov-medlineplus-images-linkout_sm.gif")
03230         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][3]["LinkName"], "Pacemakers and Implantable Defibrillators")
03231         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][3]["SubjectType"], ["consumer health"])
03232         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][3]["Provider"]["Name"], "MedlinePlus Health Information")
03233         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][3]["Provider"]["NameAbbr"], "MEDPLUS")
03234         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][3]["Provider"]["Id"], "3162")
03235         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][3]["Provider"]["Url"], "http://medlineplus.gov/")
03236         self.assertEqual(record[0]["IdUrlList"][1]["ObjUrl"][3]["Provider"]["IconUrl"], "http://www.nlm.nih.gov/medlineplus/images/linkout_sm.gif")
03237 
03238     def test_pubmed5(self):
03239         '''Test parsing pubmed links returned by ELink (fifth test)
03240         '''
03241         # List Entrez database links for PubMed PMIDs 12169658 and 11748140
03242         # To create the XML file, use
03243         # >>> Bio.Entrez.elink(dbfrom="pubmed", id="12169658,11748140",
03244         #                      cmd="acheck")
03245         handle = open('Entrez/elink7.xml', "rb")
03246         record = Entrez.read(handle)
03247         handle.close()
03248         self.assertEqual(len(record), 1)
03249         self.assertEqual(record[0]["DbFrom"], "pubmed")
03250         self.assertEqual(len(record[0]["IdCheckList"]), 2)
03251         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["Id"], "12169658")
03252         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][0]["DbTo"], "books")
03253         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][0]["LinkName"], "pubmed_books_refs")
03254         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][0]["MenuTag"], "Cited in Books")
03255         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][0]["HtmlTag"], "Cited in Books")
03256         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][0]["Priority"], "185")
03257         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][1]["DbTo"], "gene")
03258         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][1]["LinkName"], "pubmed_gene")
03259         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][1]["MenuTag"], "Gene Links")
03260         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][1]["HtmlTag"], "Gene")
03261         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][1]["Priority"], "128")
03262         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][2]["DbTo"], "geo")
03263         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][2]["LinkName"], "pubmed_geo")
03264         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][2]["MenuTag"], "GEO Profile Links")
03265         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][2]["HtmlTag"], "GEO Profiles")
03266         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][2]["Priority"], "170")
03267         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][3]["DbTo"], "homologene")
03268         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][3]["LinkName"], "pubmed_homologene")
03269         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][3]["MenuTag"], "HomoloGene Links")
03270         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][3]["HtmlTag"], "HomoloGene")
03271         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][3]["Priority"], "128")
03272         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][4]["DbTo"], "nuccore")
03273         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][4]["LinkName"], "pubmed_nuccore")
03274         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][4]["MenuTag"], "CoreNucleotide Links")
03275         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][4]["HtmlTag"], "CoreNucleotide")
03276         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][4]["Priority"], "128")
03277         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][5]["DbTo"], "nuccore")
03278         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][5]["LinkName"], "pubmed_nuccore_refseq")
03279         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][5]["MenuTag"], "CoreNucleotide (RefSeq) Links")
03280         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][5]["HtmlTag"], "CoreNucleotide (RefSeq)")
03281         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][5]["Priority"], "128")
03282         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][6]["DbTo"], "nucleotide")
03283         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][6]["LinkName"], "pubmed_nucleotide")
03284         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][6]["MenuTag"], "Nucleotide Links")
03285         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][6]["HtmlTag"], "Nucleotide")
03286         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][6]["Priority"], "135")
03287         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][7]["DbTo"], "nucleotide")
03288         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][7]["LinkName"], "pubmed_nucleotide_refseq")
03289         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][7]["MenuTag"], "Nucleotide (RefSeq) Links")
03290         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][7]["HtmlTag"], "Nucleotide (RefSeq)")
03291         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][7]["Priority"], "128")
03292         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][8]["DbTo"], "pcsubstance")
03293         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][8]["LinkName"], "pubmed_pcsubstance_mesh")
03294         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][8]["MenuTag"], "Substance (MeSH Keyword)")
03295         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][8]["HtmlTag"], "Substance (MeSH Keyword)")
03296         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][8]["Priority"], "128")
03297         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][9]["DbTo"], "pmc")
03298         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][9]["LinkName"], "pubmed_pmc_refs")
03299         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][9]["MenuTag"], "Cited in PMC")
03300         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][9]["HtmlTag"], "Cited in PMC")
03301         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][9]["Url"], "http://www.pubmedcentral.gov/tocrender.fcgi?action=cited&tool=pubmed&pubmedid=<@UID@>")
03302         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][9]["Priority"], "180")
03303         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][10]["DbTo"], "protein")
03304         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][10]["LinkName"], "pubmed_protein")
03305         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][10]["MenuTag"], "Protein Links")
03306         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][10]["HtmlTag"], "Protein")
03307         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][10]["Priority"], "140")
03308         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][11]["DbTo"], "protein")
03309         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][11]["LinkName"], "pubmed_protein_refseq")
03310         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][11]["MenuTag"], "Protein (RefSeq) Links")
03311         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][11]["HtmlTag"], "Protein (RefSeq)")
03312         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][11]["Priority"], "128")
03313         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][12]["DbTo"], "pubmed")
03314         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][12]["LinkName"], "pubmed_pubmed")
03315         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][12]["MenuTag"], "Related Articles")
03316         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][12]["HtmlTag"], "Related Articles")
03317         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][12]["Priority"], "1")
03318         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][13]["DbTo"], "taxonomy")
03319         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][13]["LinkName"], "pubmed_taxonomy_entrez")
03320         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][13]["MenuTag"], "Taxonomy via GenBank")
03321         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][13]["HtmlTag"], "Taxonomy via GenBank")
03322         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][13]["Priority"], "128")
03323         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][14]["DbTo"], "unigene")
03324         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][14]["LinkName"], "pubmed_unigene")
03325         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][14]["MenuTag"], "UniGene Links")
03326         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][14]["HtmlTag"], "UniGene")
03327         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][14]["Priority"], "128")
03328         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][15]["DbTo"], "LinkOut")
03329         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][15]["LinkName"], "ExternalLink")
03330         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][15]["MenuTag"], "LinkOut")
03331         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][15]["HtmlTag"], "LinkOut")
03332         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][0]["LinkInfo"][15]["Priority"], "255")
03333         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["Id"], "11748140")
03334         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][0]["DbTo"], "books")
03335         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][0]["LinkName"], "pubmed_books_refs")
03336         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][0]["MenuTag"], "Cited in Books")
03337         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][0]["HtmlTag"], "Cited in Books")
03338         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][0]["Priority"], "185")
03339         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][1]["DbTo"], "gene")
03340         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][1]["LinkName"], "pubmed_gene")
03341         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][1]["MenuTag"], "Gene Links")
03342         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][1]["HtmlTag"], "Gene")
03343         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][1]["Priority"], "128")
03344         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][2]["DbTo"], "geo")
03345         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][2]["LinkName"], "pubmed_geo")
03346         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][2]["MenuTag"], "GEO Profile Links")
03347         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][2]["HtmlTag"], "GEO Profiles")
03348         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][2]["Priority"], "170")
03349         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][3]["DbTo"], "nuccore")
03350         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][3]["LinkName"], "pubmed_nuccore")
03351         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][3]["MenuTag"], "CoreNucleotide Links")
03352         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][3]["HtmlTag"], "CoreNucleotide")
03353         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][3]["Priority"], "128")
03354         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][4]["DbTo"], "nuccore")
03355         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][4]["LinkName"], "pubmed_nuccore_refseq")
03356         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][4]["MenuTag"], "CoreNucleotide (RefSeq) Links")
03357         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][4]["HtmlTag"], "CoreNucleotide (RefSeq)")
03358         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][4]["Priority"], "128")
03359         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][5]["DbTo"], "nucleotide")
03360         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][5]["LinkName"], "pubmed_nucleotide")
03361         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][5]["MenuTag"], "Nucleotide Links")
03362         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][5]["HtmlTag"], "Nucleotide")
03363         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][5]["Priority"], "135")
03364         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][6]["DbTo"], "nucleotide")
03365         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][6]["LinkName"], "pubmed_nucleotide_refseq")
03366         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][6]["MenuTag"], "Nucleotide (RefSeq) Links")
03367         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][6]["HtmlTag"], "Nucleotide (RefSeq)")
03368         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][6]["Priority"], "128")
03369         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][7]["DbTo"], "pmc")
03370         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][7]["LinkName"], "pubmed_pmc_refs")
03371         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][7]["MenuTag"], "Cited in PMC")
03372         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][7]["HtmlTag"], "Cited in PMC")
03373         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][7]["Url"], "http://www.pubmedcentral.gov/tocrender.fcgi?action=cited&tool=pubmed&pubmedid=<@UID@>")
03374         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][7]["Priority"], "180")
03375         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][8]["DbTo"], "protein")
03376         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][8]["LinkName"], "pubmed_protein")
03377         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][8]["MenuTag"], "Protein Links")
03378         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][8]["HtmlTag"], "Protein")
03379         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][8]["Priority"], "140")
03380         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][9]["DbTo"], "protein")
03381         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][9]["LinkName"], "pubmed_protein_refseq")
03382         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][9]["MenuTag"], "Protein (RefSeq) Links")
03383         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][9]["HtmlTag"], "Protein (RefSeq)")
03384         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][9]["Priority"], "128")
03385         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][10]["DbTo"], "pubmed")
03386         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][10]["LinkName"], "pubmed_pubmed")
03387         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][10]["MenuTag"], "Related Articles")
03388         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][10]["HtmlTag"], "Related Articles")
03389         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][10]["Priority"], "1")
03390         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][11]["DbTo"], "taxonomy")
03391         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][11]["LinkName"], "pubmed_taxonomy_entrez")
03392         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][11]["MenuTag"], "Taxonomy via GenBank")
03393         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][11]["HtmlTag"], "Taxonomy via GenBank")
03394         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][11]["Priority"], "128")
03395         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][12]["DbTo"], "unigene")
03396         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][12]["LinkName"], "pubmed_unigene")
03397         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][12]["MenuTag"], "UniGene Links")
03398         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][12]["HtmlTag"], "UniGene")
03399         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][12]["Priority"], "128")
03400         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][13]["DbTo"], "LinkOut")
03401         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][13]["LinkName"], "ExternalLink")
03402         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][13]["MenuTag"], "LinkOut")
03403         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][13]["HtmlTag"], "LinkOut")
03404         self.assertEqual(record[0]["IdCheckList"]["IdLinkSet"][1]["LinkInfo"][13]["Priority"], "255")
03405 
03406 
03407     def test_pubmed6(self):
03408         '''Test parsing pubmed links returned by ELink (sixth test)
03409         '''
03410         # Check for the existence of a Related Articles link for PMIDs
03411         # 0611131, 111645 and 12068369
03412         # To create the XML file, use
03413         # >>> Bio.Entrez.elink(dbfrom="pubmed", id="10611131,111645",
03414         #                      id="12068369", cmd="ncheck")
03415         handle = open('Entrez/elink8.xml', "rb")
03416         record = Entrez.read(handle)
03417         handle.close()
03418         self.assertEqual(len(record), 1)
03419         self.assertEqual(record[0]["DbFrom"], "pubmed")
03420         self.assertEqual(len(record[0]["IdCheckList"]), 2)
03421         self.assertEqual(len(record[0]["IdCheckList"]["Id"]), 1)
03422         self.assertEqual(record[0]["IdCheckList"]["Id"][0], "12068369")
03423         self.assertEqual(len(record[0]["IdCheckList"]["Id"][0].attributes), 1)
03424         self.assertEqual(record[0]["IdCheckList"]["Id"][0].attributes["HasNeighbor"], "Y")
03425 
03426     def test_cancerchromosomes(self):
03427         '''Test parsing cancerchromosomes links returned by ELink
03428         '''
03429         # Retrieve neighbors for Cancer Chromosomes ID 2662 to the link
03430         # subset related by cytogenetics
03431         # To create the XML file, use
03432         # >>> Bio.Entrez.elink(dbfrom="cancerchromosomes",
03433         #                       db="cancerchromosomes", id="2662",
03434         #                       cmd="neighbor",
03435         #                       linkname="cancerchromosomes_cancerchromosomes_cyto")
03436         handle = open('Entrez/elink9.xml', "rb")
03437         record = Entrez.read(handle)
03438         handle.close()
03439         self.assertEqual(record[0]["DbFrom"], "cancerchromosomes")
03440         self.assertEqual(record[0]["IdList"], ["2662"])
03441 
03442 
03443 class EGQueryTest(unittest.TestCase):
03444     '''Tests for parsing XML output returned by EGQuery
03445     '''
03446     def test_egquery1(self):
03447         '''Test parsing XML output returned by EGQuery (first test)
03448         '''
03449         # Display counts in XML for stem cells in each Entrez database
03450         # To create the XML file, use
03451         # >>> Bio.Entrez.egquery(term="stem cells")
03452         handle = open('Entrez/egquery1.xml', "rb")
03453         record = Entrez.read(handle)
03454         handle.close()
03455         self.assertEqual(record["Term"], "stem cells")
03456 
03457         self.assertEqual(record["eGQueryResult"][0]["DbName"], "pubmed")
03458         self.assertEqual(record["eGQueryResult"][0]["MenuName"], "PubMed")
03459         self.assertEqual(record["eGQueryResult"][0]["Count"], "392")
03460         self.assertEqual(record["eGQueryResult"][0]["Status"], "Ok")
03461         self.assertEqual(record["eGQueryResult"][1]["DbName"], "pmc")
03462         self.assertEqual(record["eGQueryResult"][1]["MenuName"], "PMC")
03463         self.assertEqual(record["eGQueryResult"][1]["Count"], "173")
03464         self.assertEqual(record["eGQueryResult"][1]["Status"], "Ok")
03465         self.assertEqual(record["eGQueryResult"][2]["DbName"], "journals")
03466         self.assertEqual(record["eGQueryResult"][2]["MenuName"], "Journals")
03467         self.assertEqual(record["eGQueryResult"][2]["Count"], "0")
03468         self.assertEqual(record["eGQueryResult"][2]["Status"], "Term or Database is not found")
03469         self.assertEqual(record["eGQueryResult"][3]["DbName"], "mesh")
03470         self.assertEqual(record["eGQueryResult"][3]["MenuName"], "MeSH")
03471         self.assertEqual(record["eGQueryResult"][3]["Count"], "0")
03472         self.assertEqual(record["eGQueryResult"][3]["Status"], "Term or Database is not found")
03473         self.assertEqual(record["eGQueryResult"][4]["DbName"], "books")
03474         self.assertEqual(record["eGQueryResult"][4]["MenuName"], "Books")
03475         self.assertEqual(record["eGQueryResult"][4]["Count"], "10")
03476         self.assertEqual(record["eGQueryResult"][4]["Status"], "Ok")
03477         self.assertEqual(record["eGQueryResult"][5]["DbName"], "omim")
03478         self.assertEqual(record["eGQueryResult"][5]["MenuName"], "OMIM")
03479         self.assertEqual(record["eGQueryResult"][5]["Count"], "0")
03480         self.assertEqual(record["eGQueryResult"][5]["Status"], "Term or Database is not found")
03481         self.assertEqual(record["eGQueryResult"][6]["DbName"], "omia")
03482         self.assertEqual(record["eGQueryResult"][6]["MenuName"], "OMIA")
03483         self.assertEqual(record["eGQueryResult"][6]["Count"], "0")
03484         self.assertEqual(record["eGQueryResult"][6]["Status"], "Term or Database is not found")
03485         self.assertEqual(record["eGQueryResult"][7]["DbName"], "ncbisearch")
03486         self.assertEqual(record["eGQueryResult"][7]["MenuName"], "NCBI Web Site")
03487         self.assertEqual(record["eGQueryResult"][7]["Count"], "0")
03488         self.assertEqual(record["eGQueryResult"][7]["Status"], "Term or Database is not found")
03489         self.assertEqual(record["eGQueryResult"][8]["DbName"], "nuccore")
03490         self.assertEqual(record["eGQueryResult"][8]["MenuName"], "CoreNucleotide")
03491         self.assertEqual(record["eGQueryResult"][8]["Count"], "0")
03492         self.assertEqual(record["eGQueryResult"][8]["Status"], "Term or Database is not found")
03493         self.assertEqual(record["eGQueryResult"][9]["DbName"], "nucgss")
03494         self.assertEqual(record["eGQueryResult"][9]["MenuName"], "GSS")
03495         self.assertEqual(record["eGQueryResult"][9]["Count"], "0")
03496         self.assertEqual(record["eGQueryResult"][9]["Status"], "Term or Database is not found")
03497         self.assertEqual(record["eGQueryResult"][10]["DbName"], "nucest")
03498         self.assertEqual(record["eGQueryResult"][10]["MenuName"], "EST")
03499         self.assertEqual(record["eGQueryResult"][10]["Count"], "0")
03500         self.assertEqual(record["eGQueryResult"][10]["Status"], "Term or Database is not found")
03501         self.assertEqual(record["eGQueryResult"][11]["DbName"], "protein")
03502         self.assertEqual(record["eGQueryResult"][11]["MenuName"], "Protein")
03503         self.assertEqual(record["eGQueryResult"][11]["Count"], "0")
03504         self.assertEqual(record["eGQueryResult"][11]["Status"], "Term or Database is not found")
03505         self.assertEqual(record["eGQueryResult"][12]["DbName"], "genome")
03506         self.assertEqual(record["eGQueryResult"][12]["MenuName"], "Genome")
03507         self.assertEqual(record["eGQueryResult"][12]["Count"], "0")
03508         self.assertEqual(record["eGQueryResult"][12]["Status"], "Term or Database is not found")
03509         self.assertEqual(record["eGQueryResult"][13]["DbName"], "structure")
03510         self.assertEqual(record["eGQueryResult"][13]["MenuName"], "Structure")
03511         self.assertEqual(record["eGQueryResult"][13]["Count"], "0")
03512         self.assertEqual(record["eGQueryResult"][13]["Status"], "Term or Database is not found")
03513         self.assertEqual(record["eGQueryResult"][14]["DbName"], "taxonomy")
03514         self.assertEqual(record["eGQueryResult"][14]["MenuName"], "Taxonomy")
03515         self.assertEqual(record["eGQueryResult"][14]["Count"], "0")
03516         self.assertEqual(record["eGQueryResult"][14]["Status"], "Term or Database is not found")
03517         self.assertEqual(record["eGQueryResult"][15]["DbName"], "snp")
03518         self.assertEqual(record["eGQueryResult"][15]["MenuName"], "SNP")
03519         self.assertEqual(record["eGQueryResult"][15]["Count"], "0")
03520         self.assertEqual(record["eGQueryResult"][15]["Status"], "Term or Database is not found")
03521         self.assertEqual(record["eGQueryResult"][16]["DbName"], "gene")
03522         self.assertEqual(record["eGQueryResult"][16]["MenuName"], "Gene")
03523         self.assertEqual(record["eGQueryResult"][16]["Count"], "0")
03524         self.assertEqual(record["eGQueryResult"][16]["Status"], "Term or Database is not found")
03525         self.assertEqual(record["eGQueryResult"][17]["DbName"], "unigene")
03526         self.assertEqual(record["eGQueryResult"][17]["MenuName"], "UniGene")
03527         self.assertEqual(record["eGQueryResult"][17]["Count"], "0")
03528         self.assertEqual(record["eGQueryResult"][17]["Status"], "Term or Database is not found")
03529         self.assertEqual(record["eGQueryResult"][18]["DbName"], "cdd")
03530         self.assertEqual(record["eGQueryResult"][18]["MenuName"], "Conserved Domains")
03531         self.assertEqual(record["eGQueryResult"][18]["Count"], "0")
03532         self.assertEqual(record["eGQueryResult"][18]["Status"], "Term or Database is not found")
03533         self.assertEqual(record["eGQueryResult"][19]["DbName"], "domains")
03534         self.assertEqual(record["eGQueryResult"][19]["MenuName"], "3D Domains")
03535         self.assertEqual(record["eGQueryResult"][19]["Count"], "0")
03536         self.assertEqual(record["eGQueryResult"][19]["Status"], "Term or Database is not found")
03537         self.assertEqual(record["eGQueryResult"][20]["DbName"], "unists")
03538         self.assertEqual(record["eGQueryResult"][20]["MenuName"], "UniSTS")
03539         self.assertEqual(record["eGQueryResult"][20]["Count"], "0")
03540         self.assertEqual(record["eGQueryResult"][20]["Status"], "Term or Database is not found")
03541         self.assertEqual(record["eGQueryResult"][21]["DbName"], "popset")
03542         self.assertEqual(record["eGQueryResult"][21]["MenuName"], "PopSet")
03543         self.assertEqual(record["eGQueryResult"][21]["Count"], "0")
03544         self.assertEqual(record["eGQueryResult"][21]["Status"], "Term or Database is not found")
03545         self.assertEqual(record["eGQueryResult"][22]["DbName"], "geo")
03546         self.assertEqual(record["eGQueryResult"][22]["MenuName"], "GEO Profiles")
03547         self.assertEqual(record["eGQueryResult"][22]["Count"], "0")
03548         self.assertEqual(record["eGQueryResult"][22]["Status"], "Term or Database is not found")
03549         self.assertEqual(record["eGQueryResult"][23]["DbName"], "gds")
03550         self.assertEqual(record["eGQueryResult"][23]["MenuName"], "GEO DataSets")
03551         self.assertEqual(record["eGQueryResult"][23]["Count"], "0")
03552         self.assertEqual(record["eGQueryResult"][23]["Status"], "Term or Database is not found")
03553         self.assertEqual(record["eGQueryResult"][24]["DbName"], "homologene")
03554         self.assertEqual(record["eGQueryResult"][24]["MenuName"], "HomoloGene")
03555         self.assertEqual(record["eGQueryResult"][24]["Count"], "0")
03556         self.assertEqual(record["eGQueryResult"][24]["Status"], "Term or Database is not found")
03557         self.assertEqual(record["eGQueryResult"][25]["DbName"], "cancerchromosomes")
03558         self.assertEqual(record["eGQueryResult"][25]["MenuName"], "CancerChromosomes")
03559         self.assertEqual(record["eGQueryResult"][25]["Count"], "0")
03560         self.assertEqual(record["eGQueryResult"][25]["Status"], "Term or Database is not found")
03561         self.assertEqual(record["eGQueryResult"][26]["DbName"], "pccompound")
03562         self.assertEqual(record["eGQueryResult"][26]["MenuName"], "PubChem Compound")
03563         self.assertEqual(record["eGQueryResult"][26]["Count"], "0")
03564         self.assertEqual(record["eGQueryResult"][26]["Status"], "Term or Database is not found")
03565         self.assertEqual(record["eGQueryResult"][27]["DbName"], "pcsubstance")
03566         self.assertEqual(record["eGQueryResult"][27]["MenuName"], "PubChem Substance")
03567         self.assertEqual(record["eGQueryResult"][27]["Count"], "0")
03568         self.assertEqual(record["eGQueryResult"][27]["Status"], "Term or Database is not found")
03569         self.assertEqual(record["eGQueryResult"][28]["DbName"], "pcassay")
03570         self.assertEqual(record["eGQueryResult"][28]["MenuName"], "PubChem BioAssay")
03571         self.assertEqual(record["eGQueryResult"][28]["Count"], "0")
03572         self.assertEqual(record["eGQueryResult"][28]["Status"], "Term or Database is not found")
03573         self.assertEqual(record["eGQueryResult"][29]["DbName"], "nlmcatalog")
03574         self.assertEqual(record["eGQueryResult"][29]["MenuName"], "NLM Catalog")
03575         self.assertEqual(record["eGQueryResult"][29]["Count"], "2")
03576         self.assertEqual(record["eGQueryResult"][29]["Status"], "Ok")
03577         self.assertEqual(record["eGQueryResult"][30]["DbName"], "gensat")
03578         self.assertEqual(record["eGQueryResult"][30]["MenuName"], "GENSAT")
03579         self.assertEqual(record["eGQueryResult"][30]["Count"], "0")
03580         self.assertEqual(record["eGQueryResult"][30]["Status"], "Term or Database is not found")
03581         self.assertEqual(record["eGQueryResult"][31]["DbName"], "probe")
03582         self.assertEqual(record["eGQueryResult"][31]["MenuName"], "Probe")
03583         self.assertEqual(record["eGQueryResult"][31]["Count"], "0")
03584         self.assertEqual(record["eGQueryResult"][31]["Status"], "Term or Database is not found")
03585         self.assertEqual(record["eGQueryResult"][32]["DbName"], "genomeprj")
03586         self.assertEqual(record["eGQueryResult"][32]["MenuName"], "Genome Project")
03587         self.assertEqual(record["eGQueryResult"][32]["Count"], "0")
03588         self.assertEqual(record["eGQueryResult"][32]["Status"], "Term or Database is not found")
03589         self.assertEqual(record["eGQueryResult"][33]["DbName"], "gap")
03590         self.assertEqual(record["eGQueryResult"][33]["MenuName"], "dbGaP")
03591         self.assertEqual(record["eGQueryResult"][33]["Count"], "0")
03592         self.assertEqual(record["eGQueryResult"][33]["Status"], "Term or Database is not found")
03593         self.assertEqual(record["eGQueryResult"][34]["DbName"], "proteinclusters")
03594         self.assertEqual(record["eGQueryResult"][34]["MenuName"], "Protein Clusters")
03595         self.assertEqual(record["eGQueryResult"][34]["Count"], "0")
03596         self.assertEqual(record["eGQueryResult"][34]["Status"], "Term or Database is not found")
03597 
03598     def test_egquery2(self):
03599         '''Test parsing XML output returned by EGQuery (second test)
03600         '''
03601         # Display counts in XML for brca1 or brca2 for each Entrez database
03602         # To create the XML file, use
03603         # >>> Bio.Entrez.egquery(term="brca1 OR brca2")
03604         handle = open('Entrez/egquery2.xml', "rb")
03605         record = Entrez.read(handle)
03606         handle.close()
03607         self.assertEqual(record["Term"], "brca1 OR brca2")
03608 
03609         self.assertEqual(record["eGQueryResult"][0]["DbName"], "pubmed")
03610         self.assertEqual(record["eGQueryResult"][0]["MenuName"], "PubMed")
03611         self.assertEqual(record["eGQueryResult"][0]["Count"], "0")
03612         self.assertEqual(record["eGQueryResult"][0]["Status"], "Term or Database is not found")
03613         self.assertEqual(record["eGQueryResult"][1]["DbName"], "pmc")
03614         self.assertEqual(record["eGQueryResult"][1]["MenuName"], "PMC")
03615         self.assertEqual(record["eGQueryResult"][1]["Count"], "2739")
03616         self.assertEqual(record["eGQueryResult"][1]["Status"], "Ok")
03617         self.assertEqual(record["eGQueryResult"][2]["DbName"], "journals")
03618         self.assertEqual(record["eGQueryResult"][2]["MenuName"], "Journals")
03619         self.assertEqual(record["eGQueryResult"][2]["Count"], "0")
03620         self.assertEqual(record["eGQueryResult"][2]["Status"], "Term or Database is not found")
03621         self.assertEqual(record["eGQueryResult"][3]["DbName"], "mesh")
03622         self.assertEqual(record["eGQueryResult"][3]["MenuName"], "MeSH")
03623         self.assertEqual(record["eGQueryResult"][3]["Count"], "29")
03624         self.assertEqual(record["eGQueryResult"][3]["Status"], "Ok")
03625         self.assertEqual(record["eGQueryResult"][4]["DbName"], "books")
03626         self.assertEqual(record["eGQueryResult"][4]["MenuName"], "Books")
03627         self.assertEqual(record["eGQueryResult"][4]["Count"], "392")
03628         self.assertEqual(record["eGQueryResult"][4]["Status"], "Ok")
03629         self.assertEqual(record["eGQueryResult"][5]["DbName"], "omim")
03630         self.assertEqual(record["eGQueryResult"][5]["MenuName"], "OMIM")
03631         self.assertEqual(record["eGQueryResult"][5]["Count"], "149")
03632         self.assertEqual(record["eGQueryResult"][5]["Status"], "Ok")
03633         self.assertEqual(record["eGQueryResult"][6]["DbName"], "omia")
03634         self.assertEqual(record["eGQueryResult"][6]["MenuName"], "OMIA")
03635         self.assertEqual(record["eGQueryResult"][6]["Count"], "0")
03636         self.assertEqual(record["eGQueryResult"][6]["Status"], "Term or Database is not found")
03637         self.assertEqual(record["eGQueryResult"][7]["DbName"], "ncbisearch")
03638         self.assertEqual(record["eGQueryResult"][7]["MenuName"], "NCBI Web Site")
03639         self.assertEqual(record["eGQueryResult"][7]["Count"], "13")
03640         self.assertEqual(record["eGQueryResult"][7]["Status"], "Ok")
03641         self.assertEqual(record["eGQueryResult"][8]["DbName"], "nuccore")
03642         self.assertEqual(record["eGQueryResult"][8]["MenuName"], "CoreNucleotide")
03643         self.assertEqual(record["eGQueryResult"][8]["Count"], "4917")
03644         self.assertEqual(record["eGQueryResult"][8]["Status"], "Ok")
03645         self.assertEqual(record["eGQueryResult"][9]["DbName"], "nucgss")
03646         self.assertEqual(record["eGQueryResult"][9]["MenuName"], "GSS")
03647         self.assertEqual(record["eGQueryResult"][9]["Count"], "184")
03648         self.assertEqual(record["eGQueryResult"][9]["Status"], "Ok")
03649         self.assertEqual(record["eGQueryResult"][10]["DbName"], "nucest")
03650         self.assertEqual(record["eGQueryResult"][10]["MenuName"], "EST")
03651         self.assertEqual(record["eGQueryResult"][10]["Count"], "600")
03652         self.assertEqual(record["eGQueryResult"][10]["Status"], "Ok")
03653         self.assertEqual(record["eGQueryResult"][11]["DbName"], "protein")
03654         self.assertEqual(record["eGQueryResult"][11]["MenuName"], "Protein")
03655         self.assertEqual(record["eGQueryResult"][11]["Count"], "6779")
03656         self.assertEqual(record["eGQueryResult"][11]["Status"], "Ok")
03657         self.assertEqual(record["eGQueryResult"][12]["DbName"], "genome")
03658         self.assertEqual(record["eGQueryResult"][12]["MenuName"], "Genome")
03659         self.assertEqual(record["eGQueryResult"][12]["Count"], "44")
03660         self.assertEqual(record["eGQueryResult"][12]["Status"], "Ok")
03661         self.assertEqual(record["eGQueryResult"][13]["DbName"], "structure")
03662         self.assertEqual(record["eGQueryResult"][13]["MenuName"], "Structure")
03663         self.assertEqual(record["eGQueryResult"][13]["Count"], "29")
03664         self.assertEqual(record["eGQueryResult"][13]["Status"], "Ok")
03665         self.assertEqual(record["eGQueryResult"][14]["DbName"], "taxonomy")
03666         self.assertEqual(record["eGQueryResult"][14]["MenuName"], "Taxonomy")
03667         self.assertEqual(record["eGQueryResult"][14]["Count"], "0")
03668         self.assertEqual(record["eGQueryResult"][14]["Status"], "Term or Database is not found")
03669         self.assertEqual(record["eGQueryResult"][15]["DbName"], "snp")
03670         self.assertEqual(record["eGQueryResult"][15]["MenuName"], "SNP")
03671         self.assertEqual(record["eGQueryResult"][15]["Count"], "2013")
03672         self.assertEqual(record["eGQueryResult"][15]["Status"], "Ok")
03673         self.assertEqual(record["eGQueryResult"][16]["DbName"], "gene")
03674         self.assertEqual(record["eGQueryResult"][16]["MenuName"], "Gene")
03675         self.assertEqual(record["eGQueryResult"][16]["Count"], "1775")
03676         self.assertEqual(record["eGQueryResult"][16]["Status"], "Ok")
03677         self.assertEqual(record["eGQueryResult"][17]["DbName"], "unigene")
03678         self.assertEqual(record["eGQueryResult"][17]["MenuName"], "UniGene")
03679         self.assertEqual(record["eGQueryResult"][17]["Count"], "207")
03680         self.assertEqual(record["eGQueryResult"][17]["Status"], "Ok")
03681         self.assertEqual(record["eGQueryResult"][18]["DbName"], "cdd")
03682         self.assertEqual(record["eGQueryResult"][18]["MenuName"], "Conserved Domains")
03683         self.assertEqual(record["eGQueryResult"][18]["Count"], "17")
03684         self.assertEqual(record["eGQueryResult"][18]["Status"], "Ok")
03685         self.assertEqual(record["eGQueryResult"][19]["DbName"], "domains")
03686         self.assertEqual(record["eGQueryResult"][19]["MenuName"], "3D Domains")
03687         self.assertEqual(record["eGQueryResult"][19]["Count"], "131")
03688         self.assertEqual(record["eGQueryResult"][19]["Status"], "Ok")
03689         self.assertEqual(record["eGQueryResult"][20]["DbName"], "unists")
03690         self.assertEqual(record["eGQueryResult"][20]["MenuName"], "UniSTS")
03691         self.assertEqual(record["eGQueryResult"][20]["Count"], "198")
03692         self.assertEqual(record["eGQueryResult"][20]["Status"], "Ok")
03693         self.assertEqual(record["eGQueryResult"][21]["DbName"], "popset")
03694         self.assertEqual(record["eGQueryResult"][21]["MenuName"], "PopSet")
03695         self.assertEqual(record["eGQueryResult"][21]["Count"], "43")
03696         self.assertEqual(record["eGQueryResult"][21]["Status"], "Ok")
03697         self.assertEqual(record["eGQueryResult"][22]["DbName"], "geo")
03698         self.assertEqual(record["eGQueryResult"][22]["MenuName"], "GEO Profiles")
03699         self.assertEqual(record["eGQueryResult"][22]["Count"], "128692")
03700         self.assertEqual(record["eGQueryResult"][22]["Status"], "Ok")
03701         self.assertEqual(record["eGQueryResult"][23]["DbName"], "gds")
03702         self.assertEqual(record["eGQueryResult"][23]["MenuName"], "GEO DataSets")
03703         self.assertEqual(record["eGQueryResult"][23]["Count"], "21")
03704         self.assertEqual(record["eGQueryResult"][23]["Status"], "Ok")
03705         self.assertEqual(record["eGQueryResult"][24]["DbName"], "homologene")
03706         self.assertEqual(record["eGQueryResult"][24]["MenuName"], "HomoloGene")
03707         self.assertEqual(record["eGQueryResult"][24]["Count"], "50")
03708         self.assertEqual(record["eGQueryResult"][24]["Status"], "Ok")
03709         self.assertEqual(record["eGQueryResult"][25]["DbName"], "cancerchromosomes")
03710         self.assertEqual(record["eGQueryResult"][25]["MenuName"], "CancerChromosomes")
03711         self.assertEqual(record["eGQueryResult"][25]["Count"], "18")
03712         self.assertEqual(record["eGQueryResult"][25]["Status"], "Ok")
03713         self.assertEqual(record["eGQueryResult"][26]["DbName"], "pccompound")
03714         self.assertEqual(record["eGQueryResult"][26]["MenuName"], "PubChem Compound")
03715         self.assertEqual(record["eGQueryResult"][26]["Count"], "0")
03716         self.assertEqual(record["eGQueryResult"][26]["Status"], "Term or Database is not found")
03717         self.assertEqual(record["eGQueryResult"][27]["DbName"], "pcsubstance")
03718         self.assertEqual(record["eGQueryResult"][27]["MenuName"], "PubChem Substance")
03719         self.assertEqual(record["eGQueryResult"][27]["Count"], "26")
03720         self.assertEqual(record["eGQueryResult"][27]["Status"], "Ok")
03721         self.assertEqual(record["eGQueryResult"][28]["DbName"], "pcassay")
03722         self.assertEqual(record["eGQueryResult"][28]["MenuName"], "PubChem BioAssay")
03723         self.assertEqual(record["eGQueryResult"][28]["Count"], "0")
03724         self.assertEqual(record["eGQueryResult"][28]["Status"], "Term or Database is not found")
03725         self.assertEqual(record["eGQueryResult"][29]["DbName"], "nlmcatalog")
03726         self.assertEqual(record["eGQueryResult"][29]["MenuName"], "NLM Catalog")
03727         self.assertEqual(record["eGQueryResult"][29]["Count"], "31")
03728         self.assertEqual(record["eGQueryResult"][29]["Status"], "Ok")
03729         self.assertEqual(record["eGQueryResult"][30]["DbName"], "gensat")
03730         self.assertEqual(record["eGQueryResult"][30]["MenuName"], "GENSAT")
03731         self.assertEqual(record["eGQueryResult"][30]["Count"], "0")
03732         self.assertEqual(record["eGQueryResult"][30]["Status"], "Term or Database is not found")
03733         self.assertEqual(record["eGQueryResult"][31]["DbName"], "probe")
03734         self.assertEqual(record["eGQueryResult"][31]["MenuName"], "Probe")
03735         self.assertEqual(record["eGQueryResult"][31]["Count"], "1410")
03736         self.assertEqual(record["eGQueryResult"][31]["Status"], "Ok")
03737         self.assertEqual(record["eGQueryResult"][32]["DbName"], "genomeprj")
03738         self.assertEqual(record["eGQueryResult"][32]["MenuName"], "Genome Project")
03739         self.assertEqual(record["eGQueryResult"][32]["Count"], "0")
03740         self.assertEqual(record["eGQueryResult"][32]["Status"], "Term or Database is not found")
03741         self.assertEqual(record["eGQueryResult"][33]["DbName"], "gap")
03742         self.assertEqual(record["eGQueryResult"][33]["MenuName"], "dbGaP")
03743         self.assertEqual(record["eGQueryResult"][33]["Count"], "0")
03744         self.assertEqual(record["eGQueryResult"][33]["Status"], "Term or Database is not found")
03745         self.assertEqual(record["eGQueryResult"][34]["DbName"], "proteinclusters")
03746         self.assertEqual(record["eGQueryResult"][34]["MenuName"], "Protein Clusters")
03747         self.assertEqual(record["eGQueryResult"][34]["Count"], "0")
03748         self.assertEqual(record["eGQueryResult"][34]["Status"], "Term or Database is not found")
03749 
03750 class ESpellTest(unittest.TestCase):
03751     '''Tests for parsing XML output returned by ESpell
03752     '''
03753     def test_espell(self):
03754         '''Test parsing XML output returned by ESpell
03755         '''
03756         # Request suggestions for the PubMed search biopythooon
03757         # To create the XML file, use
03758         # >>> Bio.Entrez.espell(db="pubmed", term="biopythooon")
03759         handle = open('Entrez/espell.xml', "rb")
03760         record = Entrez.read(handle)
03761         handle.close()
03762         self.assertEqual(record["Database"], "pubmed")
03763         self.assertEqual(record["Query"], "biopythooon")
03764         self.assertEqual(record["CorrectedQuery"], "biopython")
03765         self.assertEqual(len(record["SpelledQuery"]), 1)
03766         self.assertEqual(record["SpelledQuery"][0], "biopython")
03767         self.assertEqual(record["SpelledQuery"][0].tag, "Replaced")
03768 
03769 
03770 class EFetchTest(unittest.TestCase):
03771     '''Tests for parsing XML output returned by EFetch
03772     '''
03773     def test_pubmed1(self):
03774         '''Test parsing XML returned by EFetch, PubMed database (first test)
03775         '''
03776         # In PubMed display PMIDs 12091962 and 9997 in xml retrieval mode
03777         # and abstract retrieval type.
03778         # To create the XML file, use
03779         # >>> Bio.Entrez.efetch(db='pubmed', id='12091962,9997',
03780         #                       retmode='xml', rettype='abstract')
03781         handle = open('Entrez/pubmed1.xml', "rb")
03782         record = Entrez.read(handle)
03783         handle.close()
03784         self.assertEqual(record[0]["MedlineCitation"].attributes["Owner"], "KIE")
03785         self.assertEqual(record[0]["MedlineCitation"].attributes["Status"], "MEDLINE")
03786         self.assertEqual(record[0]["MedlineCitation"]["PMID"], "12091962")
03787         self.assertEqual(record[0]["MedlineCitation"]["DateCreated"]["Year"], "1991")
03788         self.assertEqual(record[0]["MedlineCitation"]["DateCreated"]["Month"], "01")
03789         self.assertEqual(record[0]["MedlineCitation"]["DateCreated"]["Day"], "22")
03790         self.assertEqual(record[0]["MedlineCitation"]["DateCompleted"]["Year"], "1991")
03791         self.assertEqual(record[0]["MedlineCitation"]["DateCompleted"]["Month"], "01")
03792         self.assertEqual(record[0]["MedlineCitation"]["DateCompleted"]["Day"], "22")
03793         self.assertEqual(record[0]["MedlineCitation"]["DateRevised"]["Year"], "2007")
03794         self.assertEqual(record[0]["MedlineCitation"]["DateRevised"]["Month"], "11")
03795         self.assertEqual(record[0]["MedlineCitation"]["DateRevised"]["Day"], "15")
03796         self.assertEqual(record[0]["MedlineCitation"]["Article"].attributes["PubModel"], "Print")
03797         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["ISSN"], "1043-1578")
03798         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["ISSN"].attributes["IssnType"], "Print")
03799         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"].attributes["CitedMedium"], "Print")
03800         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Volume"], "17")
03801         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Issue"], "1")
03802         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Year"], "1990")
03803         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Season"], "Spring")
03804         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["Title"], "Social justice (San Francisco, Calif.)")
03805         self.assertEqual(record[0]["MedlineCitation"]["Article"]["ArticleTitle"], "The treatment of AIDS behind the walls of correctional facilities.")
03806         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Pagination"]["MedlinePgn"], "113-25")
03807         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"].attributes["CompleteYN"], 'Y')
03808         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0].attributes["ValidYN"], "Y")
03809         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0]["LastName"], "Olivero")
03810         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0]["ForeName"], "J Michael")
03811         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0]["Initials"], "JM")
03812         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Language"], ["eng"])
03813         self.assertEqual(record[0]["MedlineCitation"]["Article"]["PublicationTypeList"], ["Journal Article", "Review"])
03814         self.assertEqual(record[0]["MedlineCitation"]["MedlineJournalInfo"]["Country"], "United States")
03815         self.assertEqual(record[0]["MedlineCitation"]["MedlineJournalInfo"]["MedlineTA"], "Soc Justice")
03816         self.assertEqual(record[0]["MedlineCitation"]["MedlineJournalInfo"]["NlmUniqueID"], "9891830")
03817         self.assertEqual(record[0]["MedlineCitation"]["CitationSubset"], ["E"])
03818         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][0]["DescriptorName"], "AIDS Serodiagnosis")
03819         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][0]["DescriptorName"].attributes["MajorTopicYN"], "N")
03820         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][1]["DescriptorName"], "Acquired Immunodeficiency Syndrome")
03821         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][1]["DescriptorName"].attributes["MajorTopicYN"], "Y")
03822         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][2]["DescriptorName"], "Civil Rights")
03823         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][2]["DescriptorName"].attributes["MajorTopicYN"], "N")
03824         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][3]["DescriptorName"], "HIV Seropositivity")
03825         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][3]["DescriptorName"].attributes["MajorTopicYN"], "Y")
03826         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][4]["DescriptorName"], "Humans")
03827         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][4]["DescriptorName"].attributes["MajorTopicYN"], "N")
03828         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][5]["DescriptorName"], "Jurisprudence")
03829         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][5]["DescriptorName"].attributes["MajorTopicYN"], "Y")
03830         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][6]["DescriptorName"], "Law Enforcement")
03831         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][6]["DescriptorName"].attributes["MajorTopicYN"], "N")
03832         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["DescriptorName"], "Mass Screening")
03833         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["DescriptorName"].attributes["MajorTopicYN"], "N")
03834         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["DescriptorName"], "Minority Groups")
03835         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["DescriptorName"].attributes["MajorTopicYN"], "N")
03836         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][9]["DescriptorName"], "Organizational Policy")
03837         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][9]["DescriptorName"].attributes["MajorTopicYN"], "N")
03838         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["DescriptorName"], "Patient Care")
03839         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["DescriptorName"].attributes["MajorTopicYN"], "N")
03840         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][11]["DescriptorName"], "Prejudice")
03841         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][11]["DescriptorName"].attributes["MajorTopicYN"], "N")
03842         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][12]["DescriptorName"], "Prisoners")
03843         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][12]["DescriptorName"].attributes["MajorTopicYN"], "Y")
03844         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][13]["DescriptorName"], "Public Policy")
03845         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][13]["DescriptorName"].attributes["MajorTopicYN"], "Y")
03846         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][14]["DescriptorName"], "Quarantine")
03847         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][14]["DescriptorName"].attributes["MajorTopicYN"], "N")
03848         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][15]["DescriptorName"], "Social Control, Formal")
03849         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][15]["DescriptorName"].attributes["MajorTopicYN"], "N")
03850         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][16]["DescriptorName"], "Statistics as Topic")
03851         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][16]["DescriptorName"].attributes["MajorTopicYN"], "N")
03852         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][17]["DescriptorName"], "Stereotyping")
03853         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][17]["DescriptorName"].attributes["MajorTopicYN"], "N")
03854         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][18]["DescriptorName"], "United States")
03855         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][18]["DescriptorName"].attributes["MajorTopicYN"], "N")
03856         self.assertEqual(record[0]["MedlineCitation"]["NumberOfReferences"], "63")
03857         self.assertEqual(record[0]["MedlineCitation"]["OtherID"][0], "31840")
03858         self.assertEqual(record[0]["MedlineCitation"]["OtherID"][0].attributes["Source"], "KIE")
03859         self.assertEqual(record[0]["MedlineCitation"]["KeywordList"][0].attributes["Owner"], "KIE")
03860         self.assertEqual(record[0]["MedlineCitation"]["KeywordList"][0][0], "Health Care and Public Health")
03861         self.assertEqual(record[0]["MedlineCitation"]["KeywordList"][0][0].attributes["MajorTopicYN"], "N")
03862         self.assertEqual(record[0]["MedlineCitation"]["KeywordList"][0][1], "Legal Approach")
03863         self.assertEqual(record[0]["MedlineCitation"]["KeywordList"][0][1].attributes["MajorTopicYN"], "N")
03864         self.assertEqual(record[0]["MedlineCitation"]["GeneralNote"][0], "14 fn.")
03865         self.assertEqual(record[0]["MedlineCitation"]["GeneralNote"][0].attributes["Owner"], "KIE")
03866         self.assertEqual(record[0]["MedlineCitation"]["GeneralNote"][1], "KIE BoB Subject Heading: AIDS")
03867         self.assertEqual(record[0]["MedlineCitation"]["GeneralNote"][1].attributes["Owner"], "KIE")
03868         self.assertEqual(record[0]["MedlineCitation"]["GeneralNote"][2], "63 refs.")
03869         self.assertEqual(record[0]["MedlineCitation"]["GeneralNote"][2].attributes["Owner"], "KIE")
03870         self.assertEqual(record[0]["PubmedData"]["History"][0][0].attributes["PubStatus"], "pubmed")
03871         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Year"], "1990")
03872         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Month"], "4")
03873         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Day"], "1")
03874         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Hour"], "0")
03875         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Minute"], "0")
03876         self.assertEqual(record[0]["PubmedData"]["History"][0][1].attributes["PubStatus"], "medline")
03877         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Year"], "2002")
03878         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Month"], "7")
03879         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Day"], "16")
03880         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Hour"], "10")
03881         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Minute"], "1")
03882         self.assertEqual(record[0]["PubmedData"]["PublicationStatus"], "ppublish")
03883         self.assertEqual(len(record[0]["PubmedData"]["ArticleIdList"]), 1)
03884         self.assertEqual(record[0]["PubmedData"]["ArticleIdList"][0], "12091962")
03885         self.assertEqual(record[0]["PubmedData"]["ArticleIdList"][0].attributes["IdType"], "pubmed")
03886         self.assertEqual(record[1]["MedlineCitation"].attributes["Owner"], "NLM")
03887         self.assertEqual(record[1]["MedlineCitation"].attributes["Status"], "MEDLINE")
03888         self.assertEqual(record[1]["MedlineCitation"]["PMID"], "9997")
03889         self.assertEqual(record[1]["MedlineCitation"]["DateCreated"]["Year"], "1976")
03890         self.assertEqual(record[1]["MedlineCitation"]["DateCreated"]["Month"], "12")
03891         self.assertEqual(record[1]["MedlineCitation"]["DateCreated"]["Day"], "30")
03892         self.assertEqual(record[1]["MedlineCitation"]["DateCompleted"]["Year"], "1976")
03893         self.assertEqual(record[1]["MedlineCitation"]["DateCompleted"]["Month"], "12")
03894         self.assertEqual(record[1]["MedlineCitation"]["DateCompleted"]["Day"], "30")
03895         self.assertEqual(record[1]["MedlineCitation"]["DateRevised"]["Year"], "2003")
03896         self.assertEqual(record[1]["MedlineCitation"]["DateRevised"]["Month"], "11")
03897         self.assertEqual(record[1]["MedlineCitation"]["DateRevised"]["Day"], "14")
03898         self.assertEqual(record[1]["MedlineCitation"]["Article"].attributes["PubModel"], "Print")
03899         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["ISSN"], "0006-3002")
03900         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["ISSN"].attributes["IssnType"], "Print")
03901         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"].attributes["CitedMedium"], "Print")
03902         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Volume"], "446")
03903         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Issue"], "1")
03904         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Year"], "1976")
03905         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Month"], "Sep")
03906         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Day"], "28")
03907         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["Title"], "Biochimica et biophysica acta")
03908         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["ISOAbbreviation"], "Biochim. Biophys. Acta")
03909         self.assertEqual(record[1]["MedlineCitation"]["Article"]["ArticleTitle"], "Magnetic studies of Chromatium flavocytochrome C552. A mechanism for heme-flavin interaction.")
03910         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Pagination"]["MedlinePgn"], "179-91")
03911         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Abstract"]["AbstractText"], "Electron paramagnetic resonance and magnetic susceptibility studies of Chromatium flavocytochrome C552 and its diheme flavin-free subunit at temperatures below 45 degrees K are reported. The results show that in the intact protein and the subunit the two low-spin (S = 1/2) heme irons are distinguishable, giving rise to separate EPR signals. In the intact protein only, one of the heme irons exists in two different low spin environments in the pH range 5.5 to 10.5, while the other remains in a constant environment. Factors influencing the variable heme iron environment also influence flavin reactivity, indicating the existence of a mechanism for heme-flavin interaction.")
03912         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"].attributes["CompleteYN"], "Y")
03913         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][0].attributes["ValidYN"], "Y")
03914         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][0]["LastName"], "Strekas")
03915         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][0]["ForeName"], "T C")
03916         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][0]["Initials"], "TC")
03917         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Language"], ["eng"])
03918         self.assertEqual(record[1]["MedlineCitation"]["Article"]["PublicationTypeList"], ["Journal Article"])
03919         self.assertEqual(record[1]["MedlineCitation"]["MedlineJournalInfo"]["Country"], "NETHERLANDS")
03920         self.assertEqual(record[1]["MedlineCitation"]["MedlineJournalInfo"]["MedlineTA"], "Biochim Biophys Acta")
03921         self.assertEqual(record[1]["MedlineCitation"]["MedlineJournalInfo"]["NlmUniqueID"], "0217513")
03922         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][0]["RegistryNumber"], "0")
03923         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][0]["NameOfSubstance"], "Cytochrome c Group")
03924         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][1]["RegistryNumber"], "0")
03925         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][1]["NameOfSubstance"], "Flavins")
03926         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][2]["RegistryNumber"], "14875-96-8")
03927         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][2]["NameOfSubstance"], "Heme")
03928         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][3]["RegistryNumber"], "7439-89-6")
03929         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][3]["NameOfSubstance"], "Iron")
03930         self.assertEqual(record[1]["MedlineCitation"]["CitationSubset"], ["IM"])
03931         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][0]["DescriptorName"], "Binding Sites")
03932         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][0]["DescriptorName"].attributes["MajorTopicYN"], "N")
03933         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][1]["DescriptorName"], "Chromatium")
03934         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][1]["DescriptorName"].attributes["MajorTopicYN"], "N")
03935         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][1]["QualifierName"][0], "enzymology")
03936         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][1]["QualifierName"][0].attributes["MajorTopicYN"], "Y")
03937         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][2]["DescriptorName"], "Cytochrome c Group")
03938         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][2]["DescriptorName"].attributes["MajorTopicYN"], "Y")
03939         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][3]["DescriptorName"], "Electron Spin Resonance Spectroscopy")
03940         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][3]["DescriptorName"].attributes["MajorTopicYN"], "N")
03941         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][4]["DescriptorName"], "Flavins")
03942         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][4]["DescriptorName"].attributes["MajorTopicYN"], "N")
03943         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][5]["DescriptorName"], "Heme")
03944         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][5]["DescriptorName"].attributes["MajorTopicYN"], "N")
03945         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][6]["DescriptorName"], "Hydrogen-Ion Concentration")
03946         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][6]["DescriptorName"].attributes["MajorTopicYN"], "N")
03947         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][7]["DescriptorName"], "Iron")
03948         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][7]["DescriptorName"].attributes["MajorTopicYN"], "N")
03949         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][7]["QualifierName"][0], "analysis")
03950         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][7]["QualifierName"][0].attributes["MajorTopicYN"], "N")
03951         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][8]["DescriptorName"], "Magnetics")
03952         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][8]["DescriptorName"].attributes["MajorTopicYN"], "N")
03953         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][9]["DescriptorName"], "Oxidation-Reduction")
03954         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][9]["DescriptorName"].attributes["MajorTopicYN"], "N")
03955         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][10]["DescriptorName"], "Protein Binding")
03956         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][10]["DescriptorName"].attributes["MajorTopicYN"], "N")
03957         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][11]["DescriptorName"], "Protein Conformation")
03958         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][11]["DescriptorName"].attributes["MajorTopicYN"], "N")
03959         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][12]["DescriptorName"], "Temperature")
03960         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][12]["DescriptorName"].attributes["MajorTopicYN"], "N")
03961         self.assertEqual(record[1]["PubmedData"]["History"][0][0].attributes["PubStatus"], "pubmed")
03962         self.assertEqual(record[1]["PubmedData"]["History"][0][0]["Year"], "1976")
03963         self.assertEqual(record[1]["PubmedData"]["History"][0][0]["Month"], "9")
03964         self.assertEqual(record[1]["PubmedData"]["History"][0][0]["Day"], "28")
03965         self.assertEqual(record[1]["PubmedData"]["History"][0][1].attributes["PubStatus"], "medline")
03966         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Year"], "1976")
03967         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Month"], "9")
03968         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Day"], "28")
03969         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Hour"], "0")
03970         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Minute"], "1")
03971         self.assertEqual(record[1]["PubmedData"]["PublicationStatus"], "ppublish")
03972         self.assertEqual(len(record[1]["PubmedData"]["ArticleIdList"]), 1)
03973         self.assertEqual(record[1]["PubmedData"]["ArticleIdList"][0], "9997")
03974         self.assertEqual(record[1]["PubmedData"]["ArticleIdList"][0].attributes["IdType"], "pubmed")
03975 
03976 
03977     def test_pubmed2(self):
03978         '''Test parsing XML returned by EFetch, PubMed database (second test)
03979         '''
03980         # In PubMed display PMIDs in xml retrieval mode.
03981         # To create the XML file, use
03982         # >>> Bio.Entrez.efetch(db='pubmed', id="11748933,11700088",
03983         #                       retmode="xml")
03984         handle = open('Entrez/pubmed2.xml', "rb")
03985         record = Entrez.read(handle)
03986         handle.close()
03987         self.assertEqual(record[0]["MedlineCitation"].attributes["Owner"], "NLM")
03988         self.assertEqual(record[0]["MedlineCitation"].attributes["Status"], "MEDLINE")
03989         self.assertEqual(record[0]["MedlineCitation"]["PMID"], "11748933")
03990         self.assertEqual(record[0]["MedlineCitation"]["DateCreated"]["Year"], "2001")
03991         self.assertEqual(record[0]["MedlineCitation"]["DateCreated"]["Month"], "12")
03992         self.assertEqual(record[0]["MedlineCitation"]["DateCreated"]["Day"], "25")
03993         self.assertEqual(record[0]["MedlineCitation"]["DateCompleted"]["Year"], "2002")
03994         self.assertEqual(record[0]["MedlineCitation"]["DateCompleted"]["Month"], "03")
03995         self.assertEqual(record[0]["MedlineCitation"]["DateCompleted"]["Day"], "04")
03996         self.assertEqual(record[0]["MedlineCitation"]["DateRevised"]["Year"], "2006")
03997         self.assertEqual(record[0]["MedlineCitation"]["DateRevised"]["Month"], "11")
03998         self.assertEqual(record[0]["MedlineCitation"]["DateRevised"]["Day"], "15")
03999         self.assertEqual(record[0]["MedlineCitation"]["Article"].attributes["PubModel"], "Print")
04000         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["ISSN"], "0011-2240")
04001         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["ISSN"].attributes["IssnType"], "Print")
04002         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"].attributes["CitedMedium"], "Print")
04003         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Volume"], "42")
04004         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Issue"], "4")
04005         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Year"], "2001")
04006         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Month"], "Jun")
04007         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["Title"], "Cryobiology")
04008         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["ISOAbbreviation"], "Cryobiology")
04009         self.assertEqual(record[0]["MedlineCitation"]["Article"]["ArticleTitle"], "Is cryopreservation a homogeneous process? Ultrastructure and motility of untreated, prefreezing, and postthawed spermatozoa of Diplodus puntazzo (Cetti).")
04010         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Pagination"]["MedlinePgn"], "244-55")
04011         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Abstract"]["AbstractText"], "This study subdivides the cryopreservation procedure for Diplodus puntazzo spermatozoa into three key phases, fresh, prefreezing (samples equilibrated in cryosolutions), and postthawed stages, and examines the ultrastructural anomalies and motility profiles of spermatozoa in each stage, with different cryodiluents. Two simple cryosolutions were evaluated: 0.17 M sodium chloride containing a final concentration of 15% dimethyl sulfoxide (Me(2)SO) (cryosolution A) and 0.1 M sodium citrate containing a final concentration of 10% Me(2)SO (cryosolution B). Ultrastructural anomalies of the plasmatic and nuclear membranes of the sperm head were common and the severity of the cryoinjury differed significantly between the pre- and the postfreezing phases and between the two cryosolutions. In spermatozoa diluted with cryosolution A, during the prefreezing phase, the plasmalemma of 61% of the cells was absent or damaged compared with 24% in the fresh sample (P < 0.001). In spermatozoa diluted with cryosolution B, there was a pronounced increase in the number of cells lacking the head plasmatic membrane from the prefreezing to the postthawed stages (from 32 to 52%, P < 0.01). In both cryosolutions, damages to nuclear membrane were significantly higher after freezing (cryosolution A: 8 to 23%, P < 0.01; cryosolution B: 5 to 38%, P < 0.001). With cryosolution A, the after-activation motility profile confirmed a consistent drop from fresh at the prefreezing stage, whereas freezing and thawing did not affect the motility much further and 50% of the cells were immotile by 60-90 s after activation. With cryosolution B, only the postthawing stage showed a sharp drop of motility profile. This study suggests that the different phases of the cryoprocess should be investigated to better understand the process of sperm damage.")
04012         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Abstract"]["CopyrightInformation"], "Copyright 2001 Elsevier Science.")
04013         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Affiliation"], u'Dipartimento di Scienze Ambientali, Universit\xe0 degli Studi della Tuscia, 01100 Viterbo, Italy.')
04014         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"].attributes["CompleteYN"], "Y")
04015         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0].attributes["ValidYN"], "Y")
04016         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0]["LastName"], "Taddei")
04017         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0]["ForeName"], "A R")
04018         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0]["Initials"], "AR")
04019         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][1].attributes["ValidYN"], "Y")
04020         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][1]["LastName"], "Barbato")
04021         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][1]["ForeName"], "F")
04022         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][1]["Initials"], "F")
04023         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][2].attributes["ValidYN"], "Y")
04024         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][2]["LastName"], "Abelli")
04025         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][2]["ForeName"], "L")
04026         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][2]["Initials"], "L")
04027         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][3].attributes["ValidYN"], "Y")
04028         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][3]["LastName"], "Canese")
04029         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][3]["ForeName"], "S")
04030         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][3]["Initials"], "S")
04031         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][4].attributes["ValidYN"], "Y")
04032         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][4]["LastName"], "Moretti")
04033         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][4]["ForeName"], "F")
04034         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][4]["Initials"], "F")
04035         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][5].attributes["ValidYN"], "Y")
04036         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][5]["LastName"], "Rana")
04037         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][5]["ForeName"], "K J")
04038         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][5]["Initials"], "KJ")
04039         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][6].attributes["ValidYN"], "Y")
04040         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][6]["LastName"], "Fausto")
04041         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][6]["ForeName"], "A M")
04042         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][6]["Initials"], "AM")
04043         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][7].attributes["ValidYN"], "Y")
04044         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][7]["LastName"], "Mazzini")
04045         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][7]["ForeName"], "M")
04046         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][7]["Initials"], "M")
04047         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Language"], ["eng"])
04048         self.assertEqual(record[0]["MedlineCitation"]["Article"]["PublicationTypeList"][0], "Journal Article")
04049         self.assertEqual(record[0]["MedlineCitation"]["Article"]["PublicationTypeList"][1], "Research Support, Non-U.S. Gov't")
04050         self.assertEqual(record[0]["MedlineCitation"]["MedlineJournalInfo"]["Country"], "United States")
04051         self.assertEqual(record[0]["MedlineCitation"]["MedlineJournalInfo"]["MedlineTA"], "Cryobiology")
04052         self.assertEqual(record[0]["MedlineCitation"]["MedlineJournalInfo"]["NlmUniqueID"], "0006252")
04053         self.assertEqual(record[0]["MedlineCitation"]["CitationSubset"], ["IM"])
04054         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][0]["DescriptorName"], "Animals")
04055         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][0]["DescriptorName"].attributes["MajorTopicYN"], "N")
04056         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][1]["DescriptorName"], "Cell Membrane")
04057         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][1]["DescriptorName"].attributes["MajorTopicYN"], "N")
04058         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][1]["QualifierName"][0], "ultrastructure")
04059         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][1]["QualifierName"][0].attributes["MajorTopicYN"], "N")
04060         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][2]["DescriptorName"], "Cryopreservation")
04061         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][2]["DescriptorName"].attributes["MajorTopicYN"], "N")
04062         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][2]["QualifierName"][0], "methods")
04063         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][2]["QualifierName"][0].attributes["MajorTopicYN"], "Y")
04064         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][3]["DescriptorName"], "Male")
04065         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][3]["DescriptorName"].attributes["MajorTopicYN"], "N")
04066         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][4]["DescriptorName"], "Microscopy, Electron")
04067         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][4]["DescriptorName"].attributes["MajorTopicYN"], "N")
04068         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][5]["DescriptorName"], "Microscopy, Electron, Scanning")
04069         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][5]["DescriptorName"].attributes["MajorTopicYN"], "N")
04070         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][6]["DescriptorName"], "Nuclear Envelope")
04071         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][6]["DescriptorName"].attributes["MajorTopicYN"], "N")
04072         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][6]["QualifierName"][0], "ultrastructure")
04073         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][6]["QualifierName"][0].attributes["MajorTopicYN"], "N")
04074         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["DescriptorName"], "Sea Bream")
04075         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["DescriptorName"].attributes["MajorTopicYN"], "N")
04076         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["QualifierName"][0], "anatomy & histology")
04077         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["QualifierName"][0].attributes["MajorTopicYN"], "Y")
04078         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["QualifierName"][1], "physiology")
04079         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["QualifierName"][1].attributes["MajorTopicYN"], "N")
04080         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["DescriptorName"], "Semen Preservation")
04081         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["DescriptorName"].attributes["MajorTopicYN"], "N")
04082         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["QualifierName"][0], "adverse effects")
04083         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["QualifierName"][0].attributes["MajorTopicYN"], "N")
04084         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["QualifierName"][1], "methods")
04085         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["QualifierName"][1].attributes["MajorTopicYN"], "Y")
04086         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][9]["DescriptorName"], "Sperm Motility")
04087         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][9]["DescriptorName"].attributes["MajorTopicYN"], "Y")
04088         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["DescriptorName"], "Spermatozoa")
04089         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["DescriptorName"].attributes["MajorTopicYN"], "N")
04090         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["QualifierName"][0], "physiology")
04091         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["QualifierName"][0].attributes["MajorTopicYN"], "N")
04092         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["QualifierName"][1], "ultrastructure")
04093         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["QualifierName"][1].attributes["MajorTopicYN"], "Y")
04094         self.assertEqual(record[0]["PubmedData"]["History"][0][0].attributes["PubStatus"], "pubmed")
04095         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Year"], "2001")
04096         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Month"], "12")
04097         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Day"], "26")
04098         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Hour"], "10")
04099         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Minute"], "0")
04100         self.assertEqual(record[0]["PubmedData"]["History"][0][1].attributes["PubStatus"], "medline")
04101         self.assertEqual(record[0]["PubmedData"]["Hi