Subject: | Problem with tests and canned responses |
Date: | Sun, 4 Nov 2007 18:03:24 +0100 |
To: | bug-Net-Amazon [...] rt.cpan.org |
From: | gregor herrmann <gregor+debian [...] comodo.priv.at> |
When I built Net::Amazon in a chroot I noticed a problem when running
'make test', e.g. in t/007Manufacturer.t:
First the canned responses are used but when the request method gets
to $res->is_page_available it tries to fetch page 2 over the net
instead of using the canned responses.
The following patch seems to fix this:
#v+
--- lib/Net/Amazon.pm (revision 8833)
+++ lib/Net/Amazon.pm (working copy)
@@ -482,7 +482,8 @@
##################################################
my($self, $ref, $new_items, $page) = @_;
if(exists $ref->{Items}->{TotalPages} and
- $ref->{Items}->{TotalPages} > $page) {
+ $ref->{Items}->{TotalPages} > $page and
+ $IS_CANNED ne 1) {
DEBUG("Page $page of $ref->{Items}->{TotalPages} fetched - continuing");
return 1;
}
#v-
Cheers,
gregor (Debian Perl Group)
--
.''`. http://info.comodo.priv.at/ | gpg key ID: 0x00F3CFE4
: :' : debian: the universal operating system - http://www.debian.org/
`. `' member of https://www.vibe.at/ | how to reply: http://got.to/quote/
`- NP: JBO: Frauen
Message body not shown because it is not plain text.