Add functional test for object PUT with raw iterator

Adds a functional test to verify change made in [1]

[1] change id I19579ed7a0181ac3f488433e7c1839f7f7a040b8

Change-Id: I45dbf66edab645e6339e67906aee5faa4fb7efbd
This commit is contained in:
Alistair Coles
2016-01-05 18:25:19 +00:00
parent 39b1a31d8a
commit ab34609050

View File

@@ -318,6 +318,21 @@ class TestFunctional(testtools.TestCase):
downloaded_contents += body.read()
self.assertEqual(self.test_data, downloaded_contents)
def test_put_object_using_generator(self):
# verify that put using a generator yielding empty strings does not
# cause connection to be closed
def data():
yield "should"
yield ""
yield " tolerate"
yield ""
yield " empty chunks"
self.conn.put_object(
self.containername, self.objectname, data())
hdrs, body = self.conn.get_object(self.containername, self.objectname)
self.assertEqual("should tolerate empty chunks", body)
def test_post_account(self):
self.conn.post_account({'x-account-meta-data': 'Something'})
headers = self.conn.head_account()