Ejemplo n.º 1
0
 def testGetLineageInfoDoesNotCloseOpenDatabase(self):
     """
     getLineageInfo should not close an open database it is passed.
     """
     blastHits = BlastHits(None)
     blastHits.addHit("Smiley Cell Polyomavirus", {"taxID": 4})
     db = FakeDbConnection([("species", 1), ("A")])
     taxonomy.getLineageInfo(blastHits, db=db)
     self.assertEqual(True, db.open)
Ejemplo n.º 2
0
 def testGetLineageInfo(self):
     """
     getLineageInfo should return the right taxIDs from
     the database
     """
     blastHits = BlastHits(None)
     blastHits.addHit("Smiley Cell Polyomavirus", {"taxID": 4})
     db = FakeDbConnection([("species", 1), ("A")])
     result = taxonomy.getLineageInfo(blastHits, db=db)
     self.assertEqual({4: [{"taxID": 4, "parentTaxID": 1, "rank": "species", "scientificName": "A"}]}, result)