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);