diff -Naur tests/unit/botocore/test_client.py awscli-2.15.40_/tests/unit/botocore/test_client.py --- tests/unit/botocore/test_client.py 2024-04-20 15:00:39.465686191 +0800 +++ awscli-2.15.40_/tests/unit/botocore/test_client.py 2024-04-20 15:07:29.335115713 +0800 @@ -960,7 +960,7 @@ lines = [ (' Creates an iterator that will paginate through responses ' 'from :py:meth:`MyService.Client.test_operation`.'), - ' **Request Syntax** ', + ' **Request Syntax**', ' ::', ' response_iterator = paginator.paginate(', " Foo='string',", @@ -976,17 +976,17 @@ ' :type Bar: string', ' :param Bar: Documents Bar', ' :type PaginationConfig: dict', - ' :param PaginationConfig: ', + ' :param PaginationConfig:', (' A dictionary that provides parameters to control ' 'pagination.'), - ' - **MaxItems** *(integer) --* ', + ' - **MaxItems** *(integer) --*', (' The total number of items to return. If the total ' 'number of items available is more than the value specified ' 'in max-items then a ``NextToken`` will be provided in the ' 'output that you can use to resume pagination.'), - ' - **PageSize** *(integer) --* ', + ' - **PageSize** *(integer) --*', ' The size of each page.', - ' - **StartingToken** *(string) --* ', + ' - **StartingToken** *(string) --*', (' A token to specify where to start paginating. This is ' 'the ``NextToken`` from a previous response.'), ' :returns: None', diff -Naur tests/unit/botocore/test_waiters.py awscli-2.15.40_/tests/unit/botocore/test_waiters.py --- tests/unit/botocore/test_waiters.py 2024-04-20 15:00:39.469019486 +0800 +++ awscli-2.15.40_/tests/unit/botocore/test_waiters.py 2024-04-20 15:04:08.810188250 +0800 @@ -648,7 +648,7 @@ (' Polls :py:meth:`MyService.Client.foo` every 1 ' 'seconds until a successful state is reached. An error ' 'is returned after 1 failed checks.'), - ' **Request Syntax** ', + ' **Request Syntax**', ' ::', ' waiter.wait(', " bar='string'", diff -Naur tests/unit/botocore/test_utils.py awscli-2.15.40_/tests/unit/botocore/test_utils.py --- tests/unit/botocore/test_utils.py 2024-04-20 12:09:38.883650919 +0800 +++ awscli-2.15.40_/tests/unit/botocore/test_utils.py 2024-04-20 12:11:56.434812142 +0800 @@ -1000,17 +1000,24 @@ 'https://bucket.s3.amazonaws.com/key.txt') -class TestSwitchToChunkedEncodingForNonSeekableObjects(unittest.TestCase): - def test_switch_to_chunked_encodeing_for_stream_like_object(self): - request = AWSRequest( - method='POST', headers={}, - data=io.BufferedIOBase(b"some initial binary data"), - url='https://foo.amazonaws.com/bucket/key.txt' - ) - prepared_request = request.prepare() - self.assertEqual( - prepared_request.headers, {'Transfer-Encoding': 'chunked'} - ) +def test_chunked_encoding_used_for_stream_like_object(): + class BufferedStream(io.BufferedIOBase): + """Class to ensure seek/tell don't work, but read is implemented.""" + + def __init__(self, value): + self.value = io.BytesIO(value) + + def read(self, size=-1): + return self.value.read(size) + + request = AWSRequest( + method='POST', + headers={}, + data=BufferedStream(b"some initial binary data"), + url='https://foo.amazonaws.com/bucket/key.txt', + ) + prepared_request = request.prepare() + assert prepared_request.headers == {'Transfer-Encoding': 'chunked'} class TestInstanceCache(unittest.TestCase):