Merge pull request #2474 from jrstarke/2473
Added Exception to describe_container_instances to match aws api
This commit is contained in:
		
						commit
						c46ee4cf8d
					
				| @ -790,6 +790,8 @@ class EC2ContainerServiceBackend(BaseBackend): | |||||||
|         cluster_name = cluster_str.split('/')[-1] |         cluster_name = cluster_str.split('/')[-1] | ||||||
|         if cluster_name not in self.clusters: |         if cluster_name not in self.clusters: | ||||||
|             raise Exception("{0} is not a cluster".format(cluster_name)) |             raise Exception("{0} is not a cluster".format(cluster_name)) | ||||||
|  |         if not list_container_instance_ids: | ||||||
|  |             raise JsonRESTError('InvalidParameterException', 'Container instance cannot be empty') | ||||||
|         failures = [] |         failures = [] | ||||||
|         container_instance_objects = [] |         container_instance_objects = [] | ||||||
|         for container_instance_id in list_container_instance_ids: |         for container_instance_id in list_container_instance_ids: | ||||||
|  | |||||||
| @ -889,6 +889,12 @@ def test_describe_container_instances(): | |||||||
|         instance.keys().should.contain('runningTasksCount') |         instance.keys().should.contain('runningTasksCount') | ||||||
|         instance.keys().should.contain('pendingTasksCount') |         instance.keys().should.contain('pendingTasksCount') | ||||||
| 
 | 
 | ||||||
|  |     with assert_raises(ClientError) as e: | ||||||
|  |         ecs_client.describe_container_instances( | ||||||
|  |             cluster=test_cluster_name, | ||||||
|  |             containerInstances=[] | ||||||
|  |         ) | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| @mock_ec2 | @mock_ec2 | ||||||
| @mock_ecs | @mock_ecs | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user