Adds Support for filtering on schedulingStrategy in ECS#list_services (#2180)

This commit is contained in:
Kyle Decot 2019-05-02 14:00:28 -04:00 committed by Terry Cain
commit 8cb4db1896
3 changed files with 20 additions and 7 deletions

View file

@ -388,23 +388,32 @@ def test_list_services():
cluster='test_ecs_cluster',
serviceName='test_ecs_service1',
taskDefinition='test_ecs_task',
schedulingStrategy='REPLICA',
desiredCount=2
)
_ = client.create_service(
cluster='test_ecs_cluster',
serviceName='test_ecs_service2',
taskDefinition='test_ecs_task',
schedulingStrategy='DAEMON',
desiredCount=2
)
response = client.list_services(
unfiltered_response = client.list_services(
cluster='test_ecs_cluster'
)
len(response['serviceArns']).should.equal(2)
response['serviceArns'][0].should.equal(
len(unfiltered_response['serviceArns']).should.equal(2)
unfiltered_response['serviceArns'][0].should.equal(
'arn:aws:ecs:us-east-1:012345678910:service/test_ecs_service1')
response['serviceArns'][1].should.equal(
unfiltered_response['serviceArns'][1].should.equal(
'arn:aws:ecs:us-east-1:012345678910:service/test_ecs_service2')
filtered_response = client.list_services(
cluster='test_ecs_cluster',
schedulingStrategy='REPLICA'
)
len(filtered_response['serviceArns']).should.equal(1)
filtered_response['serviceArns'][0].should.equal(
'arn:aws:ecs:us-east-1:012345678910:service/test_ecs_service1')
@mock_ecs
def test_describe_services():