Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests cleanup #75

Merged
merged 7 commits into from
Nov 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changes
^^^^^^^^^^^^^^^^^^

* Added enforcement of plain response #57 (thanks @rymir)
* botocore updated to version 1.4.73 #74 (thanks @vas3k)


0.0.5 (2016-06-01)
Expand Down
2 changes: 1 addition & 1 deletion aiobotocore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .session import get_session, AioSession

__version__ = '0.0.5'
__version__ = '0.0.6'
(get_session, AioSession) # make pyflakes happy
7 changes: 4 additions & 3 deletions aiobotocore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ def __aexit__(self, exc_type, exc_val, exc_tb):
exc_val, exc_tb)

def close(self):
"""Close all http connections"""
# ClientSession.close() from aiohttp returns asyncio.Future here so
# this method could be used with yield from/await
"""Close all http connections. This is coroutine, and should be
awaited. Method will be coroutine (instead returning Future) once
aiohttp does that.
"""
return self._endpoint._aio_session.close()


Expand Down
1 change: 1 addition & 0 deletions examples/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ def go(loop):
resp = yield from client.delete_object(Bucket=bucket, Key=key)
print(resp)


loop = asyncio.get_event_loop()
loop.run_until_complete(go(loop))
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flake8==3.0.4
flake8==3.2.0
pytest==3.0.4
pytest-cov==2.4.0
coverage==4.2
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from setuptools import setup, find_packages


install_requires = ['botocore>=1.4.0, <=1.4.73', 'aiohttp>=0.21.2']
install_requires = ['botocore>=1.4.29, <=1.4.73', 'aiohttp>=0.22.5']

PY_VER = sys.version_info

Expand Down
5 changes: 5 additions & 0 deletions tests/test_basic_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def test_get_object_stream_wrapper(s3_client, create_object, bucket_name):
chunk2 = yield from body.read()
assert chunk1 == b'b'
assert chunk2 == b'ody contents'
response['Body'].close()


@pytest.mark.run_loop
Expand Down Expand Up @@ -204,6 +205,7 @@ def test_unicode_key_put_list(s3_client, bucket_name, create_object):
assert parsed['Contents'][0]['Key'] == key_name
parsed = yield from s3_client.get_object(Bucket=bucket_name, Key=key_name)
data = yield from parsed['Body'].read()
parsed['Body'].close()
assert data == b'foo'


Expand Down Expand Up @@ -255,6 +257,7 @@ def test_copy_with_quoted_char(s3_client, create_object, bucket_name):
# Now verify we can retrieve the copied object.
resp = yield from s3_client.get_object(Bucket=bucket_name, Key=key_name2)
data = yield from resp['Body'].read()
resp['Body'].close()
assert data == b'foo'


Expand All @@ -271,6 +274,7 @@ def test_copy_with_query_string(s3_client, create_object, bucket_name):
# Now verify we can retrieve the copied object.
resp = yield from s3_client.get_object(Bucket=bucket_name, Key=key_name2)
data = yield from resp['Body'].read()
resp['Body'].close()
assert data == b'foo'


Expand All @@ -287,6 +291,7 @@ def test_can_copy_with_dict_form(s3_client, create_object, bucket_name):
# Now verify we can retrieve the copied object.
resp = yield from s3_client.get_object(Bucket=bucket_name, Key=key_name2)
data = yield from resp['Body'].read()
resp['Body'].close()
assert data == b'foo'


Expand Down