Fix DescribeImages to throw error if AMI requested does not exist

This commit is contained in:
Hugo Lopes Tavares 2014-01-28 18:14:00 -05:00
commit 90aa87d53e
5 changed files with 25 additions and 6 deletions

View file

@ -39,3 +39,9 @@ def test_ami_pulls_attributes_from_instance():
image_id = conn.create_image(instance.id, "test-ami", "this is a test ami")
image = conn.get_image(image_id)
image.kernel_id.should.equal('test-kernel')
@mock_ec2
def test_getting_missing_ami():
conn = boto.connect_ec2('the_key', 'the_secret')
conn.get_image.when.called_with('ami-missing').should.throw(EC2ResponseError)