def test_search(self): tax = taxonomy.Taxonomy() res = tax.search("yeast", ) self.assertIn("4932", res) res = tax.search("human", exact=True) self.assertEqual(res, ["9606"])
def setUp(self): self.common_ids = taxonomy.common_taxids() self.organisms = [(taxonomy.name(tax_id), tax_id) for tax_id in self.common_ids] self.taxon = taxonomy.Taxonomy()
def test_lineage(self): tax = taxonomy.Taxonomy() lineage = tax._tax.lineage("9606") self.assertEqual(lineage[0], "1") self.assertEqual(lineage[-1], "9605")
def test_other_names(self): tax = taxonomy.Taxonomy() names = tax.other_names("4932") self.assertIn(("brewer's yeast", "common name"), names) self.assertIn(("baker's yeast", 'genbank common name'), names)
def test_name(self): tax = taxonomy.Taxonomy() self.assertEqual(tax["9606"], "H**o sapiens") self.assertEqual(tax["4932"], "Saccharomyces cerevisiae")
def test_other_names(self): tax = taxonomy.Taxonomy() names = tax.other_names("4932") self.assertIn(("brewer's yeast", "common name"), names) self.assertIn(("lager beer yeast", "common name"), names)