From 18ed73292caa5464bfffef6b6302f97648df556d Mon Sep 17 00:00:00 2001 From: Michael van Tellingen Date: Fri, 14 Apr 2017 18:16:24 +0200 Subject: [PATCH] Return the revision in ecs.register_task_definition This matches boto, see http://boto3.readthedocs.io/en/latest/reference/services/ecs.html#ECS.Client.register_task_definition --- moto/ecs/models.py | 1 + tests/test_ecs/test_ecs_boto3.py | 1 + 2 files changed, 2 insertions(+) diff --git a/moto/ecs/models.py b/moto/ecs/models.py index aadc76bce..35bccd625 100644 --- a/moto/ecs/models.py +++ b/moto/ecs/models.py @@ -89,6 +89,7 @@ class TaskDefinition(BaseObject): def __init__(self, family, revision, container_definitions, volumes=None): self.family = family + self.revision = revision self.arn = 'arn:aws:ecs:us-east-1:012345678910:task-definition/{0}:{1}'.format( family, revision) self.container_definitions = container_definitions diff --git a/tests/test_ecs/test_ecs_boto3.py b/tests/test_ecs/test_ecs_boto3.py index e76be8cbe..fd5443ab9 100644 --- a/tests/test_ecs/test_ecs_boto3.py +++ b/tests/test_ecs/test_ecs_boto3.py @@ -86,6 +86,7 @@ def test_register_task_definition(): ] ) type(response['taskDefinition']).should.be(dict) + response['taskDefinition']['revision'].should.equal(1) response['taskDefinition']['taskDefinitionArn'].should.equal( 'arn:aws:ecs:us-east-1:012345678910:task-definition/test_ecs_task:1') response['taskDefinition']['containerDefinitions'][