Merge pull request #1849 from hashicorp/f-aws-update-s3-website-tests

update tests so go vet is happy
This commit is contained in:
Clint 2015-05-07 10:06:43 -05:00
commit ef62385a95
2 changed files with 8 additions and 5 deletions

View File

@ -213,7 +213,7 @@ func resourceAwsS3BucketWebsitePut(s3conn *s3.S3, d *schema.ResourceData, websit
WebsiteConfiguration: websiteConfiguration,
}
log.Printf("[DEBUG] S3 put bucket website: %s", putInput)
log.Printf("[DEBUG] S3 put bucket website: %#v", putInput)
_, err := s3conn.PutBucketWebsite(putInput)
if err != nil {
@ -227,7 +227,7 @@ func resourceAwsS3BucketWebsiteDelete(s3conn *s3.S3, d *schema.ResourceData) err
bucket := d.Get("bucket").(string)
deleteInput := &s3.DeleteBucketWebsiteInput{Bucket: aws.String(bucket)}
log.Printf("[DEBUG] S3 delete bucket website: %s", deleteInput)
log.Printf("[DEBUG] S3 delete bucket website: %#v", deleteInput)
_, err := s3conn.DeleteBucketWebsite(deleteInput)
if err != nil {

View File

@ -131,16 +131,19 @@ func testAccCheckAWSS3BucketWebsite(n string, indexDoc string, errorDoc string)
}
if *out.IndexDocument.Suffix != indexDoc {
return fmt.Errorf("bad: %s", out.IndexDocument)
if out.IndexDocument.Suffix != nil {
return fmt.Errorf("bad index document suffix: %s", *out.IndexDocument.Suffix)
}
return fmt.Errorf("bad index document suffix, is nil")
}
if v := out.ErrorDocument; v == nil {
if errorDoc != "" {
return fmt.Errorf("bad: %s", out.ErrorDocument)
return fmt.Errorf("bad error doc, found nil, expected: %s", errorDoc)
}
} else {
if *v.Key != errorDoc {
return fmt.Errorf("bad: %s", out.ErrorDocument)
return fmt.Errorf("bad error doc, expected: %s, got %#v", errorDoc, out.ErrorDocument)
}
}