summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormadhuri <madhuri@madhuri-VirtualBox.(none)>2014-03-06 12:31:38 +0530
committerMadhuri Kumari <madhuri.rai07@gmail.com>2014-03-07 10:31:24 +0530
commitfc499f3092c616deb6ec5dc089d5a05903538d5c (patch)
treefac355eafa3c7c70100ff68f400edd8268a38000
parent63dad5c8f4062531004b5d3a5edb4878127ca5a8 (diff)
downloadswift-fc499f3092c616deb6ec5dc089d5a05903538d5c.tar.gz
Added a test for empty metadata
Here added a test for setting empty object metadata and checking its value in response headers. Change-Id: I460302661d150364a95bcd7f0ebbbc2a1e95507a
-rwxr-xr-xtest/unit/obj/test_server.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/obj/test_server.py b/test/unit/obj/test_server.py
index 6a38df6e6..59555073a 100755
--- a/test/unit/obj/test_server.py
+++ b/test/unit/obj/test_server.py
@@ -231,6 +231,19 @@ class TestObjectController(unittest.TestCase):
"X-Object-Meta-3" in resp.headers)
self.assertEquals(resp.headers['Content-Type'], 'application/x-test')
+ # Test for empty metadata
+ timestamp = normalize_timestamp(time())
+ req = Request.blank('/sda1/p/a/c/o',
+ environ={'REQUEST_METHOD': 'POST'},
+ headers={'X-Timestamp': timestamp,
+ 'Content-Type': 'application/x-test',
+ 'X-Object-Meta-3': ''})
+ resp = req.get_response(self.object_controller)
+ self.assertEqual(resp.status_int, 202)
+ req = Request.blank('/sda1/p/a/c/o')
+ resp = req.get_response(self.object_controller)
+ self.assertEquals(resp.headers["x-object-meta-3"], '')
+
def test_POST_old_timestamp(self):
ts = time()
timestamp = normalize_timestamp(ts)