Browse files

fix get_count so it returns the actual number of IDs returned if no a…

…ctual count is set
  • Loading branch information...
1 parent be285e2 commit 7990837e8bd0266759a144d8277a38e1a2c11931 Chris Fields committed Oct 15, 2010
Showing with 5 additions and 3 deletions.
  1. +1 −1 Bio/Tools/EUtilities.pm
  2. +1 −1 Bio/Tools/EUtilities/Summary/ItemContainerI.pm
  3. +3 −1 t/RemoteDB/EUtilities.t
View
2 Bio/Tools/EUtilities.pm
@@ -731,7 +731,7 @@ sub get_count {
$self->warn("Unknown database $db");
return;
} else {
- return $self->{'_count'};
+ return $self->{'_count'} || scalar($self->get_ids);
}
}
View
2 Bio/Tools/EUtilities/Summary/ItemContainerI.pm
@@ -209,7 +209,7 @@ sub get_Items_by_name {
=head2 get_contents_by_name
Title : get_contents_by_name
- Usage : my ($data) = get_contents_by_name('CreateDate')
+ Usage : my ($data) = $eutil->get_contents_by_name('CreateDate')
Function : Returns content for named Item(s) in DocSum (indicated by
passed argument)
Returns : array of values (type varies per Item)
View
4 t/RemoteDB/EUtilities.t
@@ -138,8 +138,10 @@ sub epost {
is($eutil->get_database, 'protein', '$epost->get_database()');
is(join(',',$eutil->get_ids), '1621261,20807972,68536103,730439,89318838', '$epost->get_ids()');
+ # these are the submitted IDs
+ is($eutil->get_count, 5, '$epost->get_count()');
+
# these are not set using epost
- is($eutil->get_count, undef, '$epost->get_count()');
is($eutil->get_term, undef, '$epost->get_term()');
my $history = $eutil->next_History;

0 comments on commit 7990837

Please sign in to comment.