Make functests py3-compatible
Change-Id: I2b3bf17e874cf049eccab4c85ceac7da10d258ef
This commit is contained in:
parent
b57044a853
commit
304da900da
@ -110,15 +110,20 @@ class TestFunctional(unittest.TestCase):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def _check_account_headers(self, headers):
|
def _check_account_headers(self, headers):
|
||||||
self.assertTrue(headers.get('content-length'))
|
headers_to_check = [
|
||||||
self.assertTrue(headers.get('x-account-object-count'))
|
'content-length',
|
||||||
self.assertTrue(headers.get('x-timestamp'))
|
'x-account-object-count',
|
||||||
self.assertTrue(headers.get('x-trans-id'))
|
'x-timestamp',
|
||||||
self.assertTrue(headers.get('date'))
|
'x-trans-id',
|
||||||
self.assertTrue(headers.get('x-account-bytes-used'))
|
'date',
|
||||||
self.assertTrue(headers.get('x-account-container-count'))
|
'x-account-bytes-used',
|
||||||
self.assertTrue(headers.get('content-type'))
|
'x-account-container-count',
|
||||||
self.assertTrue(headers.get('accept-ranges'))
|
'content-type',
|
||||||
|
'accept-ranges',
|
||||||
|
]
|
||||||
|
for h in headers_to_check:
|
||||||
|
self.assertIn(h, headers)
|
||||||
|
self.assertTrue(headers[h])
|
||||||
|
|
||||||
def test_stat_account(self):
|
def test_stat_account(self):
|
||||||
headers = self.conn.head_account()
|
headers = self.conn.head_account()
|
||||||
@ -322,16 +327,16 @@ class TestFunctional(unittest.TestCase):
|
|||||||
# verify that put using a generator yielding empty strings does not
|
# verify that put using a generator yielding empty strings does not
|
||||||
# cause connection to be closed
|
# cause connection to be closed
|
||||||
def data():
|
def data():
|
||||||
yield "should"
|
yield b"should"
|
||||||
yield ""
|
yield b""
|
||||||
yield " tolerate"
|
yield b" tolerate"
|
||||||
yield ""
|
yield b""
|
||||||
yield " empty chunks"
|
yield b" empty chunks"
|
||||||
|
|
||||||
self.conn.put_object(
|
self.conn.put_object(
|
||||||
self.containername, self.objectname, data())
|
self.containername, self.objectname, data())
|
||||||
hdrs, body = self.conn.get_object(self.containername, self.objectname)
|
hdrs, body = self.conn.get_object(self.containername, self.objectname)
|
||||||
self.assertEqual("should tolerate empty chunks", body)
|
self.assertEqual(b"should tolerate empty chunks", body)
|
||||||
|
|
||||||
def test_download_object_retry_chunked(self):
|
def test_download_object_retry_chunked(self):
|
||||||
resp_chunk_size = 2
|
resp_chunk_size = 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user