'1. Invalid parameters to Boto\'s EBS API calls
raise the right exception after logging to Eliot.
2. Verify Eliot log output for expected message fields
from logging decorator for boto.exception.EC2Exception
originating from boto.ec2.connection.EC2Connection.'

@capture_logging((lambda self, logger: None))
def test_boto_ec2response_error(self, logger):

    self.assertRaises(ClientError, self.api.create_volume, dataset_id=uuid4(), size=0)
    self.api.zone = u'invalid_zone'
    self.assertRaises(ClientError, self.api.create_volume, dataset_id=uuid4(), size=self.minimum_allocatable_size)
    expected_message_keys = {AWS_CODE.key, AWS_MESSAGE.key, AWS_REQUEST_ID.key}
    for logged in LoggedAction.of_type(logger.messages, AWS_ACTION):
        key_subset = set((key for key in expected_message_keys if (key in logged.end_message.keys())))
        self.assertEqual(expected_message_keys, key_subset)
