AnyEvent-Net-Amazon-S3

 view release on metacpan or  search on metacpan

t/02client.t  view on Meta::CPAN

push @etags, $put_part_response->header('ETag');

# TODO list part? - We've got this, but how to expose it nicely?

#complete multipart upload
my $complete_upload_response;
ok(
    $complete_upload_response = $object->complete_multipart_upload( upload_id => $upload_id, part_numbers => [1,2], etags => \@etags),
    "successful response for complete multipart upload"
);
#get the file and check that it looks like we expect
ok($object->exists, "object has now been created");

$tmp_fh = File::Temp->new();
$object->get_filename($tmp_fh->filename);
is( stat($tmp_fh->filename)->size, 6 * 1024 * 1024, "downloaded file has a size equivalent to the sum of it's parts");

$tmp_fh->seek((5 * 1024 * 1024) - 1, SEEK_SET);#jump to 5MB position
my $test_bytes;
read($tmp_fh, $test_bytes, 2);
is($test_bytes, "xz", "The second chunk of the file begins in the correct place");



( run in 0.501 second using v1.01-cache-2.11-cpan-64827b87656 )