Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-Amazon-S3 CPAN distribution.

Report information
The Basics
Id: 30595
Status: resolved
Priority: 0/
Queue: Net-Amazon-S3

People
Owner: Nobody in particular
Requestors: bdonlan [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.40
Fixed in: (no value)



Currently, expensive tests are broken due to the README's filesize and md5 having changed. This patch updates the tests to compute the md5 and filesize of the local copy rather than using hardcoded constants.
Subject: s3-fixtests.patch
diff -aur Net-Amazon-S3-0.40.orig/t/01api.t Net-Amazon-S3-0.40.fixtests/t/01api.t --- Net-Amazon-S3-0.40.orig/t/01api.t 2007-10-30 07:41:37.000000000 -0400 +++ Net-Amazon-S3-0.40.fixtests/t/01api.t 2007-11-08 20:11:18.000000000 -0500 @@ -185,6 +185,8 @@ $bucket_obj->delete_key($keyname); # now play with the file methods +my $readme_md5 = file_md5_hex('README'); +my $readme_size = -s 'README'; $keyname .= "2"; $bucket_obj->add_key_filename( $keyname, 'README', @@ -195,18 +197,18 @@ $response = $bucket_obj->get_key($keyname); is( $response->{content_type}, 'text/plain' ); like( $response->{value}, qr/and unknown Amazon/ ); -is( $response->{etag}, '7ad9ac8f950a8e29d7f83c4bff903f08' ); +is( $response->{etag}, $readme_md5 ); is( $response->{'x-amz-meta-colour'}, 'orangy' ); -is( $response->{content_length}, 13_396 ); +is( $response->{content_length}, $readme_size ); unlink('t/README'); $response = $bucket_obj->get_key_filename( $keyname, undef, 't/README' ); is( $response->{content_type}, 'text/plain' ); is( $response->{value}, '' ); -is( $response->{etag}, '7ad9ac8f950a8e29d7f83c4bff903f08' ); -is( file_md5_hex('t/README'), '7ad9ac8f950a8e29d7f83c4bff903f08' ); +is( $response->{etag}, $readme_md5 ); +is( file_md5_hex('t/README'), $readme_md5 ); is( $response->{'x-amz-meta-colour'}, 'orangy' ); -is( $response->{content_length}, 13_396 ); +is( $response->{content_length}, $readme_size ); $bucket_obj->delete_key($keyname);
Thanks for the patch, it's in 0.41 which just hit CPAN.