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
This commit is contained in:
parent
63dad5c8f4
commit
fc499f3092
@ -231,6 +231,19 @@ class TestObjectController(unittest.TestCase):
|
|||||||
"X-Object-Meta-3" in resp.headers)
|
"X-Object-Meta-3" in resp.headers)
|
||||||
self.assertEquals(resp.headers['Content-Type'], 'application/x-test')
|
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):
|
def test_POST_old_timestamp(self):
|
||||||
ts = time()
|
ts = time()
|
||||||
timestamp = normalize_timestamp(ts)
|
timestamp = normalize_timestamp(ts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user