Merge branch 'master' into fix_lambda_publish_version

This commit is contained in:
Tomoya Iwata 2019-03-29 09:52:47 +09:00
commit 7e28fa7bfe
8 changed files with 38 additions and 13 deletions

View file

@ -448,8 +448,8 @@ def test_short_form_func_in_yaml_teamplate():
KeySplit: !Split [A, B]
KeySub: !Sub A
"""
yaml.add_multi_constructor('', yaml_tag_constructor)
template_dict = yaml.load(template)
yaml.add_multi_constructor('', yaml_tag_constructor, Loader=yaml.Loader)
template_dict = yaml.load(template, Loader=yaml.Loader)
key_and_expects = [
['KeyRef', {'Ref': 'foo'}],
['KeyB64', {'Fn::Base64': 'valueToEncode'}],

View file

@ -47,6 +47,15 @@ def test_list_clusters():
'arn:aws:ecs:us-east-1:012345678910:cluster/test_cluster1')
@mock_ecs
def test_describe_clusters():
client = boto3.client('ecs', region_name='us-east-1')
response = client.describe_clusters(clusters=["some-cluster"])
response['failures'].should.contain({
'arn': 'arn:aws:ecs:us-east-1:012345678910:cluster/some-cluster',
'reason': 'MISSING'
})
@mock_ecs
def test_delete_cluster():
client = boto3.client('ecs', region_name='us-east-1')

View file

@ -8,8 +8,8 @@ import sure # noqa
from moto import mock_kms, mock_kms_deprecated
from nose.tools import assert_raises
from freezegun import freeze_time
from datetime import datetime, timedelta
from dateutil.tz import tzlocal
from datetime import datetime
from dateutil.tz import tzutc
@mock_kms_deprecated
@ -660,7 +660,7 @@ def test_schedule_key_deletion():
KeyId=key['KeyMetadata']['KeyId']
)
assert response['KeyId'] == key['KeyMetadata']['KeyId']
assert response['DeletionDate'] == datetime(2015, 1, 31, 12, 0, tzinfo=tzlocal())
assert response['DeletionDate'] == datetime(2015, 1, 31, 12, 0, tzinfo=tzutc())
else:
# Can't manipulate time in server mode
response = client.schedule_key_deletion(
@ -685,7 +685,7 @@ def test_schedule_key_deletion_custom():
PendingWindowInDays=7
)
assert response['KeyId'] == key['KeyMetadata']['KeyId']
assert response['DeletionDate'] == datetime(2015, 1, 8, 12, 0, tzinfo=tzlocal())
assert response['DeletionDate'] == datetime(2015, 1, 8, 12, 0, tzinfo=tzutc())
else:
# Can't manipulate time in server mode
response = client.schedule_key_deletion(

View file

@ -15,6 +15,7 @@ class AuthenticatedClient(FlaskClient):
def open(self, *args, **kwargs):
kwargs['headers'] = kwargs.get('headers', {})
kwargs['headers']['Authorization'] = "Any authorization header"
kwargs['content_length'] = 0 # Fixes content-length complaints.
return super(AuthenticatedClient, self).open(*args, **kwargs)

View file

@ -13,6 +13,7 @@ class AuthenticatedClient(FlaskClient):
def open(self, *args, **kwargs):
kwargs['headers'] = kwargs.get('headers', {})
kwargs['headers']['Authorization'] = "Any authorization header"
kwargs['content_length'] = 0 # Fixes content-length complaints.
return super(AuthenticatedClient, self).open(*args, **kwargs)