  def testS3(self):
    """S3 End to end test on AWS.

    Test creating a bucket, uploading an object, fetching it, removing the
    object and deleting the bucket.
    """
    aws_account = account.AWSAccount(self.zone)
    client = aws_account.ClientApi(S3_SERVICE)
    key = __file__.split('/')[-1]
    local_path = os.path.realpath(__file__)

    # Create the bucket
    aws_account.s3.CreateBucket(self.s3_bucket)
    self.assertIn('LocationConstraint',
      client.get_bucket_location(Bucket=self.s3_bucket))

    # Upload an object
    aws_account.s3.Put(self.s3_bucket, local_path)
    self.assertTrue(aws_account.s3.CheckForObject(self.s3_bucket, key))

    # Remove the object
    aws_account.s3.RmObject(self.s3_bucket, key)
    self.assertFalse(aws_account.s3.CheckForObject(self.s3_bucket, key))

    # Remove the bucket
    aws_account.s3.RmBucket(self.s3_bucket)
    with self.assertRaises(client.exceptions.ClientError):
      client.get_bucket_location(Bucket=self.s3_bucket)
S3 End to end test on AWS.

Test creating a bucket, uploading an object, fetching it, removing the
object and deleting the bucket.
tests/providers/aws/e2e.py