From 0d4d2b70415c4c2ab03ef6a35bfc8946db6f8ff2 Mon Sep 17 00:00:00 2001 From: William Harvey Date: Tue, 10 Sep 2019 14:24:00 -0400 Subject: [PATCH] Fix/tighten AWS Batch test_reregister_task_definition unit test --- tests/test_batch/test_batch.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/test_batch/test_batch.py b/tests/test_batch/test_batch.py index 89a8d4d0e..5487cfb91 100644 --- a/tests/test_batch/test_batch.py +++ b/tests/test_batch/test_batch.py @@ -563,6 +563,38 @@ def test_reregister_task_definition(): resp2['jobDefinitionArn'].should_not.equal(resp1['jobDefinitionArn']) + resp3 = batch_client.register_job_definition( + jobDefinitionName='sleep10', + type='container', + containerProperties={ + 'image': 'busybox', + 'vcpus': 1, + 'memory': 42, + 'command': ['sleep', '10'] + } + ) + resp3['revision'].should.equal(3) + + resp3['jobDefinitionArn'].should_not.equal(resp1['jobDefinitionArn']) + resp3['jobDefinitionArn'].should_not.equal(resp2['jobDefinitionArn']) + + resp4 = batch_client.register_job_definition( + jobDefinitionName='sleep10', + type='container', + containerProperties={ + 'image': 'busybox', + 'vcpus': 1, + 'memory': 41, + 'command': ['sleep', '10'] + } + ) + resp4['revision'].should.equal(4) + + resp4['jobDefinitionArn'].should_not.equal(resp1['jobDefinitionArn']) + resp4['jobDefinitionArn'].should_not.equal(resp2['jobDefinitionArn']) + resp4['jobDefinitionArn'].should_not.equal(resp3['jobDefinitionArn']) + + @mock_ec2 @mock_ecs