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:
Tim Burke 2018-05-29 17:00:24 -07:00
parent c88d4d7a98
commit caa3c67e0b
2 changed files with 6 additions and 6 deletions

View File

@ -68,9 +68,9 @@ class TestContainer(unittest2.TestCase):
return check_response(conn)
def delete(url, token, parsed, conn, container, obj):
conn.request(
'DELETE', '/'.join([parsed.path, container, obj['name']]), '',
{'X-Auth-Token': token})
path = '/'.join([parsed.path, container,
obj['name'].encode('utf8')])
conn.request('DELETE', path, '', {'X-Auth-Token': token})
return check_response(conn)
for container in (self.name, self.container):

View File

@ -104,9 +104,9 @@ class TestObject(unittest2.TestCase):
# delete an object
def delete(url, token, parsed, conn, container, obj):
conn.request(
'DELETE', '/'.join([parsed.path, container, obj['name']]), '',
{'X-Auth-Token': token})
path = '/'.join([parsed.path, container,
obj['name'].encode('utf8')])
conn.request('DELETE', path, '', {'X-Auth-Token': token})
return check_response(conn)
for container in self.containers: