Commit cf247233 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

add test for compute_one_line_detailed_taxonomy

parent a4a79948
Pipeline #37465 passed with stages
in 6 minutes and 3 seconds
......@@ -27,6 +27,12 @@ class TestBuildHierarchy(APITestCase):
rank="phylum",
parent=cls.kingdom
)
cls.species = TaxonomyFactory(
tax_id="4",
name="Genus Species",
rank="species",
parent=cls.phylum
)
def test_build_hierarchy(self):
expected_dict = {
......@@ -44,3 +50,13 @@ class TestBuildHierarchy(APITestCase):
self.assertDictEqual(test_dict, expected_dict)
self.assertIsNotNone(getattr(self.phylum, 'hierarchy'))
self.assertDictEqual(getattr(self.phylum, 'hierarchy'), expected_dict)
def test_compute_one_line_detailed_taxonomy(self):
expected_str = "k__; p__; c__; o__; f__; g__; s__"
self.assertEqual(self.root.one_line_detailed_taxonomy, expected_str)
expected_str = "k__KINGDOM; p__; c__; o__; f__; g__; s__"
self.assertEqual(self.kingdom.one_line_detailed_taxonomy, expected_str)
expected_str = "k__KINGDOM; p__PHYLUM; c__; o__; f__; g__; s__"
self.assertEqual(self.phylum.one_line_detailed_taxonomy, expected_str)
expected_str = "k__KINGDOM; p__PHYLUM; c__; o__; f__; g__; s__Species"
self.assertEqual(self.species.one_line_detailed_taxonomy, expected_str)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment