From 45128723542e230e82e900163414a0aad0c98417 Mon Sep 17 00:00:00 2001 From: Andrey Kislyuk Date: Wed, 11 Dec 2019 15:03:46 -0800 Subject: [PATCH 1/2] Batch: job definitions default to ACTIVE --- moto/batch/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moto/batch/models.py b/moto/batch/models.py index ab52db54..4bea21b4 100644 --- a/moto/batch/models.py +++ b/moto/batch/models.py @@ -182,7 +182,7 @@ class JobDefinition(BaseModel): self._region = region_name self.container_properties = container_properties self.arn = None - self.status = "INACTIVE" + self.status = "ACTIVE" if parameters is None: parameters = {} From 777ff5a62ade92c95296ae48c90ee961ca574402 Mon Sep 17 00:00:00 2001 From: Andrey Kislyuk Date: Fri, 13 Dec 2019 05:07:29 +0000 Subject: [PATCH 2/2] Add test --- tests/test_batch/test_batch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_batch/test_batch.py b/tests/test_batch/test_batch.py index 691d90b6..3bad93cf 100644 --- a/tests/test_batch/test_batch.py +++ b/tests/test_batch/test_batch.py @@ -608,6 +608,9 @@ def test_describe_task_definition(): resp = batch_client.describe_job_definitions(jobDefinitions=["sleep10", "test1"]) len(resp["jobDefinitions"]).should.equal(3) + for job_definition in resp["jobDefinitions"]: + job_definition["status"].should.equal("ACTIVE") + @mock_logs @mock_ec2