-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-0.96.0' into develop
* release-0.96.0: Bumping version to 0.96.0 Update elastictranscoder model Add test for PendingDeprecationWarnings Add pending deprecations to old style interface
- Loading branch information
Showing
7 changed files
with
147 additions
and
14 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
57 changes: 46 additions & 11 deletions
57
botocore/data/aws/elastictranscoder/2012-09-25.normal.json
Large diffs are not rendered by default.
Oops, something went wrong.
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,58 @@ | ||
# Copyright 2015 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. | ||
import sys | ||
from tests import unittest | ||
import contextlib | ||
import warnings | ||
|
||
from nose.tools import assert_equal | ||
from nose.tools import assert_true | ||
|
||
import botocore.session | ||
|
||
|
||
@contextlib.contextmanager | ||
def assert_warns(warning_type, contains=''): | ||
# The warnings module keeps state at the module level. | ||
# In order to give each test a clean slate we need to wipe | ||
# this state out before yielding back to the test. | ||
for v in sys.modules.values(): | ||
if getattr(v, '__warningregistry__', None): | ||
v.__warningregistry__ = {} | ||
with warnings.catch_warnings(record=True) as w: | ||
warnings.simplefilter('always') | ||
yield | ||
assert_true(len(w) > 0) | ||
assert_equal(w[0].category, warning_type) | ||
if contains: | ||
assert_true(contains in str(w[0].message), | ||
'"%s" not in: %s"' % (contains, w[0].message)) | ||
|
||
|
||
class TestDeprecationsHaveWarnings(unittest.TestCase): | ||
def setUp(self): | ||
self.session = botocore.session.get_session() | ||
|
||
def test_get_service_deprecated(self): | ||
with assert_warns(PendingDeprecationWarning, contains='get_service'): | ||
self.session.get_service('cloudformation') | ||
|
||
def test_service_get_operation_deprecated(self): | ||
service = self.session.get_service('cloudformation') | ||
with assert_warns(PendingDeprecationWarning, contains='get_operation'): | ||
service.get_operation('ListStacks') | ||
|
||
def test_get_endpoint(self): | ||
service = self.session.get_service('cloudformation') | ||
with assert_warns(PendingDeprecationWarning, contains='get_endpoint'): | ||
service.get_endpoint('us-east-1') |