]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
Add test for HEAD of a zero-byte object 88/head
authorAndrew Gaul <andrew@gaul.org>
Tue, 15 Dec 2015 08:03:37 +0000 (00:03 -0800)
committerAndrew Gaul <andrew@gaul.org>
Tue, 15 Dec 2015 08:16:06 +0000 (00:16 -0800)
Signed-off-by: Andrew Gaul <andrew@gaul.org>
s3tests/functional/test_s3.py

index 9d59605e7dc269e7258f94695a7f335dd7262ae0..4862757d0fa804ac359951fd4e472904472a4be6 100644 (file)
@@ -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')