-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1221 from jakob-keller/bump-botocore
Bump `botocore` dependency specification
- Loading branch information
Showing
12 changed files
with
342 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '2.15.2' | ||
__version__ = '2.16.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). You | ||
# may not use this file except in compliance with the License. A copy of | ||
# the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "license" file accompanying this file. This file is | ||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF | ||
# ANY KIND, either express or implied. See the License for the specific | ||
# language governing permissions and limitations under the License. | ||
|
||
from botocore.compat import parse_qs, urlparse | ||
|
||
|
||
def _urlparse(url): | ||
if isinstance(url, bytes): | ||
# Not really necessary, but it helps to reduce noise on Python 2.x | ||
url = url.decode('utf8') | ||
return urlparse(url) | ||
|
||
|
||
def assert_url_equal(url1, url2): | ||
parts1 = _urlparse(url1) | ||
parts2 = _urlparse(url2) | ||
|
||
# Because the query string ordering isn't relevant, we have to parse | ||
# every single part manually and then handle the query string. | ||
assert parts1.scheme == parts2.scheme | ||
assert parts1.netloc == parts2.netloc | ||
assert parts1.path == parts2.path | ||
assert parts1.params == parts2.params | ||
assert parts1.fragment == parts2.fragment | ||
assert parts1.username == parts2.username | ||
assert parts1.password == parts2.password | ||
assert parts1.hostname == parts2.hostname | ||
assert parts1.port == parts2.port | ||
assert parse_qs(parts1.query) == parse_qs(parts2.query) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). You | ||
# may not use this file except in compliance with the License. A copy of | ||
# the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "license" file accompanying this file. This file is | ||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF | ||
# ANY KIND, either express or implied. See the License for the specific | ||
# language governing permissions and limitations under the License. | ||
|
||
from unittest import mock | ||
|
||
from aiobotocore import handlers | ||
|
||
|
||
class TestHandlers: | ||
async def test_500_status_code_set_for_200_response(self): | ||
http_response = mock.Mock() | ||
http_response.status_code = 200 | ||
|
||
async def content(): | ||
return """ | ||
<Error> | ||
<Code>AccessDenied</Code> | ||
<Message>Access Denied</Message> | ||
<RequestId>id</RequestId> | ||
<HostId>hostid</HostId> | ||
</Error> | ||
""" | ||
|
||
http_response.content = content() | ||
await handlers.check_for_200_error((http_response, {})) | ||
assert http_response.status_code == 500 | ||
|
||
async def test_200_response_with_no_error_left_untouched(self): | ||
http_response = mock.Mock() | ||
http_response.status_code = 200 | ||
|
||
async def content(): | ||
return "<NotAnError></NotAnError>" | ||
|
||
http_response.content = content() | ||
await handlers.check_for_200_error((http_response, {})) | ||
# We don't touch the status code since there are no errors present. | ||
assert http_response.status_code == 200 | ||
|
||
async def test_500_response_can_be_none(self): | ||
# A 500 response can raise an exception, which means the response | ||
# object is None. We need to handle this case. | ||
await handlers.check_for_200_error(None) |
Oops, something went wrong.