Skip to content
Snippets Groups Projects
Commit d7d9bdac authored by Andy Yates's avatar Andy Yates
Browse files

Classificaiton was not working as expected

parent dbeed8a3
No related branches found
No related tags found
No related merge requests found
...@@ -262,8 +262,9 @@ sub get_genebuild { ...@@ -262,8 +262,9 @@ sub get_genebuild {
sub get_classification { sub get_classification {
my ($self) = @_; my ($self) = @_;
my $classification = $self->list_value_by_key('species.classification'); my $classification = $self->list_value_by_key('species.classification');
splice(@{$classification}, 0, 2); # remove the sapiens, Homo from the backing array my $copy = [@{$classification}];
return $classification; splice(@{$copy}, 0, 1); # remove the Homo sapiens
return $copy;
} }
......
...@@ -63,6 +63,12 @@ $mc->store_key_value('species.division',$divname); ...@@ -63,6 +63,12 @@ $mc->store_key_value('species.division',$divname);
$div = $mc->get_division(); $div = $mc->get_division();
ok($div eq $divname); ok($div eq $divname);
#
# classification
#
my $classification = [ qw/Hominidae Catarrhini Primates Eutheria Mammalia Vertebrata Chordata Metazoa Eukaryota/ ];
is_deeply($mc->get_classification(), $classification, 'Checking classification as expected');
# #
# Testing get_Species() # Testing get_Species()
# #
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
27 1 species.classification Hominidae 27 1 species.classification Hominidae
34 1 species.classification Metazoa 34 1 species.classification Metazoa
35 1 species.classification Eukaryota 35 1 species.classification Eukaryota
26 1 species.classification Homo sapiens
36 1 species.common_name Human 36 1 species.common_name Human
70 1 species.scientific_name Homo sapiens 70 1 species.scientific_name Homo sapiens
3 1 species.taxonomy_id 9606 3 1 species.taxonomy_id 9606
......
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