Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More Bio::DB::Taxonomy::list tests

  • Loading branch information...
commit 35f1b073fd587d1493bc534b2239cb029c7c7abe 1 parent 66155f4
@fangly fangly authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 t/RemoteDB/Taxonomy.t
View
10 t/RemoteDB/Taxonomy.t
@@ -7,7 +7,7 @@ BEGIN {
use lib '.';
use Bio::Root::Test;
- test_begin(-tests => 152,
+ test_begin(-tests => 155,
-requires_module => 'XML::Twig');
use_ok('Bio::DB::Taxonomy');
@@ -167,6 +167,10 @@ is $db_list->get_num_taxa, 4;
@h_lineage = ('Eukaryota', 'Mammalia', 'Homo', 'Homo erectus');
$db_list->add_lineage(-names => \@h_lineage, -ranks => \@ranks);
+ok my @taxa = map {$db_list->get_taxon(-name=>$_)} @h_lineage;
+is_deeply [map {ref($_)} @taxa], ['Bio::Taxon','Bio::Taxon','Bio::Taxon','Bio::Taxon'];
+is_deeply [map {$_->rank} @taxa], \@ranks, 'Ranks';
+
# Make a tree
ok my $tree = $db_list->get_tree('Homo sapiens', 'Homo erectus');
isa_ok $tree, 'Bio::Tree::TreeI';
@@ -333,7 +337,7 @@ is scalar @taxonids, 3;
# bug: duplicate topmost taxa
$db_list = Bio::DB::Taxonomy->new( -source => 'list',
-names => ['Bacteria', 'Tenericutes'] );
-$db_list->add_lineage( -names => ['Bacteria'] );
+$db_list->add_lineage( -names => ['Bacteria'] );
@taxonids = $db_list->get_taxonids('Bacteria');
is scalar @taxonids, 1;
@@ -348,5 +352,5 @@ is scalar @taxonids, 2; # multiple taxa would match using $db_list->get_taxon(-n
ok $node = $db_list->get_taxon( -names => ['c__Gammaproteobacteria', 'o__Alteromonadales' , 'f__Alteromonadaceae'] );
is $node->ancestor->node_name, 'o__Alteromonadales';
-ok $node = $db_list->get_taxon( -names => ['c__Gammaproteobacteria', 'o__Oceanospirillales' , 'f__Alteromonadaceae'] );
+ok $node = $db_list->get_taxon( -names => ['c__Gammaproteobacteria', 'o__Oceanospirillales', 'f__Alteromonadaceae'] );
is $node->ancestor->node_name, 'o__Oceanospirillales';
Please sign in to comment.
Something went wrong with that request. Please try again.