add test_object_copy_zero_size

This commit is contained in:
Yehuda Sadeh 2012-02-06 16:38:42 -08:00
parent e9492927ae
commit c509158413

View file

@ -2579,6 +2579,19 @@ def test_bucket_create_naming_good_contains_period():
def test_bucket_create_naming_good_contains_hyphen(): def test_bucket_create_naming_good_contains_hyphen():
check_good_bucket_name('aaa-111') 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(resource='object')
@attr(method='put') @attr(method='put')
@attr(operation='copy object in same bucket') @attr(operation='copy object in same bucket')