]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
Add test for COPY Content-Type header 85/head
authorRobin H. Johnson <robin.johnson@dreamhost.com>
Fri, 13 Nov 2015 06:06:21 +0000 (22:06 -0800)
committerRobin H. Johnson <robin.johnson@dreamhost.com>
Fri, 13 Nov 2015 06:09:05 +0000 (22:09 -0800)
Issue #11563 deals with the COPY command breaking the Content-Type
header. Add a test case for this to ensure it remains fixed.

Reference: http://tracker.ceph.com/issues/11563
Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
s3tests/functional/test_s3.py

index 28905aee7535a8814ba80af543881a3ebd06d72e..e0939a6d8549fcafef4df6f2d8563d4be173d024 100644 (file)
@@ -4461,6 +4461,21 @@ def test_object_copy_same_bucket():
     key2 = bucket.get_key('bar321foo')
     eq(key2.get_contents_as_string(), 'foo')
 
+# http://tracker.ceph.com/issues/11563
+@attr(resource='object')
+@attr(method='put')
+@attr(operation='copy object with content-type')
+@attr(assertion='works')
+def test_object_copy_verify_contenttype():
+    bucket = get_new_bucket()
+    key = bucket.new_key('foo123bar')
+    content_type = 'text/bla'
+    key.set_contents_from_string('foo',headers={'Content-Type': content_type})
+    key.copy(bucket, 'bar321foo')
+    key2 = bucket.get_key('bar321foo')
+    eq(key2.get_contents_as_string(), 'foo')
+    eq(key2.content_type, content_type)
+
 @attr(resource='object')
 @attr(method='put')
 @attr(operation='copy object to itself')