functests: Clean up objects better
Since JSON object listings deserialize as unicode, obj['name'] would hoist *everything* to unicode. If the account or container name was a byte string, though, it would trip a UnicodeDecodeError. Change-Id: I2c1932143b78521c6bdcfa48182b475528fc1bb3
This commit is contained in:
parent
c88d4d7a98
commit
caa3c67e0b
@ -68,9 +68,9 @@ class TestContainer(unittest2.TestCase):
|
|||||||
return check_response(conn)
|
return check_response(conn)
|
||||||
|
|
||||||
def delete(url, token, parsed, conn, container, obj):
|
def delete(url, token, parsed, conn, container, obj):
|
||||||
conn.request(
|
path = '/'.join([parsed.path, container,
|
||||||
'DELETE', '/'.join([parsed.path, container, obj['name']]), '',
|
obj['name'].encode('utf8')])
|
||||||
{'X-Auth-Token': token})
|
conn.request('DELETE', path, '', {'X-Auth-Token': token})
|
||||||
return check_response(conn)
|
return check_response(conn)
|
||||||
|
|
||||||
for container in (self.name, self.container):
|
for container in (self.name, self.container):
|
||||||
|
@ -104,9 +104,9 @@ class TestObject(unittest2.TestCase):
|
|||||||
|
|
||||||
# delete an object
|
# delete an object
|
||||||
def delete(url, token, parsed, conn, container, obj):
|
def delete(url, token, parsed, conn, container, obj):
|
||||||
conn.request(
|
path = '/'.join([parsed.path, container,
|
||||||
'DELETE', '/'.join([parsed.path, container, obj['name']]), '',
|
obj['name'].encode('utf8')])
|
||||||
{'X-Auth-Token': token})
|
conn.request('DELETE', path, '', {'X-Auth-Token': token})
|
||||||
return check_response(conn)
|
return check_response(conn)
|
||||||
|
|
||||||
for container in self.containers:
|
for container in self.containers:
|
||||||
|
Loading…
Reference in New Issue
Block a user