Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
metagenedb
Commits
cf247233
Commit
cf247233
authored
Sep 15, 2020
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
backend/metagenedb/apps/catalog/models/test_taxonomy.py
View file @
cf247233
...
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment