From c5091584138d8fd6f5c383de215d52265ee1454e Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 6 Feb 2012 16:38:42 -0800 Subject: [PATCH] add test_object_copy_zero_size --- s3tests/functional/test_s3.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/s3tests/functional/test_s3.py b/s3tests/functional/test_s3.py index 78c3087..060f371 100644 --- a/s3tests/functional/test_s3.py +++ b/s3tests/functional/test_s3.py @@ -2579,6 +2579,19 @@ def test_bucket_create_naming_good_contains_period(): def test_bucket_create_naming_good_contains_hyphen(): check_good_bucket_name('aaa-111') +@attr(resource='object') +@attr(method='put') +@attr(operation='copy zero sized object in same bucket') +@attr(assertion='works') +def test_object_copy_zero_size(): + bucket = get_new_bucket() + key = bucket.new_key('foo123bar') + fp_a = FakeWriteFile(0, '') + key.set_contents_from_file(fp_a) + key.copy(bucket, 'bar321foo') + key2 = bucket.get_key('bar321foo') + eq(key2.size, 0) + @attr(resource='object') @attr(method='put') @attr(operation='copy object in same bucket')