From 7ac3a4008a817bdad90901b79b8b5b6b0140bcf4 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Tue, 15 Dec 2015 00:03:37 -0800 Subject: [PATCH] Add test for HEAD of a zero-byte object Signed-off-by: Andrew Gaul --- s3tests/functional/test_s3.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/s3tests/functional/test_s3.py b/s3tests/functional/test_s3.py index 9d59605..4862757 100644 --- a/s3tests/functional/test_s3.py +++ b/s3tests/functional/test_s3.py @@ -905,6 +905,18 @@ def test_multi_object_delete(): eq(len(result.errors), 0) eq(len(bucket.get_all_keys()), 0) +@attr(resource='object') +@attr(method='put') +@attr(operation='write zero-byte key') +@attr(assertion='correct content length') +def test_object_head_zero_bytes(): + bucket = get_new_bucket() + key = bucket.new_key('foo') + key.set_contents_from_string('') + + key2 = bucket.get_key('foo') + eq(key2.content_length, '0') + @attr(resource='object') @attr(method='put') @attr(operation='write key')