Support for ecs describe_task_definition (#777)

* describe_task_definition support

* Refactor fetch_task_definition

* Add ECS Descriptors  (#772)

* Add support for "DescribeServices" in ecs mock

* Add support for "DescribeTaskDefinition" in ecs

* Let ecs responses handle baseobject for services

* Update Cloudformation/parsing#load_parameters to split commadelimitedlists into lists (#774)

* Fix JSON dump error in ecs.update_service with task_definition (#775)

* Fix s3bucketpath handling for IP based requests (#765)

* check HTTP header for IPv4 or IPv6 addresses and default to path based S3

* improved IPv4 and IPv6 checking with optional ports

* typo

* Freezetime.

* Add S3 ACL for aws-exec-read. Closes #740.

* Fixed time formatting in ec2/models.py (#778)

* Fixed time formatting in ec2/models.py

* Used freezegun on test that was failing due to time progression causing timestamp differences.

* rename duplicate rds/models db_instance_identifier to physical_resource_id (#776)

* rename duplicate db_instance_identifier to physical_resource_id

* Update create_from_cloudformation_json to use db_source_identifier str

* Update code to be more conventional.

* describe_task_definition support

* Refactor fetch_task_definition
This commit is contained in:
Paul Cieslar 2016-12-03 23:12:22 +00:00 committed by Steve Pulec
commit ee8e72766a
3 changed files with 38 additions and 5 deletions

View file

@ -832,6 +832,31 @@ def test_describe_tasks():
set([response['tasks'][0]['taskArn'], response['tasks'][1]['taskArn']]).should.equal(set(tasks_arns))
@mock_ecs
def describe_task_definition():
client = boto3.client('ecs', region_name='us-east-1')
container_definition = {
'name': 'hello_world',
'image': 'docker/hello-world:latest',
'cpu': 1024,
'memory': 400,
'essential': True,
'environment': [{
'name': 'AWS_ACCESS_KEY_ID',
'value': 'SOME_ACCESS_KEY'
}],
'logConfiguration': {'logDriver': 'json-file'}
}
task_definition = client.register_task_definition(
family='test_ecs_task',
containerDefinitions=[container_definition]
)
family = task_definition['family']
task = client.describe_task_definition(taskDefinition=family)
task['containerDefinitions'][0].should.equal(container_definition)
task['taskDefinitionArn'].should.equal('arn:aws:ecs:us-east-1:012345678910:task-definition/test_ecs_task2:1')
task['volumes'].should.equal([])
@mock_ec2
@mock_ecs
def test_stop_task():