def test_relabel_stratified_taxonomy_unknown_species(self):
     species = ('k__Bacteria; p__Firmicutes; c__Bacilli; '
                'o__Lactobacillales; f__Lactobacillaceae; '
                'g__Lactobacillus; s__reuteri')
     exp = ('k__Bacteria; p__Firmicutes; c__Bacilli; o__Lactobacillales; '
            'f__Lactobacillaceae; g__Lactobacillus')
     obs = cross_validate._relabel_stratified_taxonomy(
         species, self.valid_taxonomies)
     self.assertEqual(exp, obs)
 def test_relabel_stratified_taxonomy_unknown_kingdom(self):
     species = 'k__Peanut'
     with self.assertRaisesRegex(RuntimeError, "unknown kingdom"):
         cross_validate._relabel_stratified_taxonomy(
             species, self.valid_taxonomies)