Skip to content

Commit

Permalink
Fix error regexp for storage bucket website test
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
emilymye authored and modular-magician committed Jan 17, 2020
1 parent aab7402 commit 4e126d7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions google/resource_storage_bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"log"
"regexp"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -851,10 +850,7 @@ func TestAccStorageBucket_website(t *testing.T) {
t.Parallel()

bucketSuffix := acctest.RandomWithPrefix("tf-website-test")

websiteKeys := []string{"website.0.main_page_suffix", "website.0.not_found_page"}
errMsg := fmt.Sprintf("one of `%s` must be specified", strings.Join(websiteKeys, ","))
fullErr := fmt.Sprintf("config is invalid: 2 problems:\n\n- \"%s\": %s\n- \"%s\": %s", websiteKeys[0], errMsg, websiteKeys[1], errMsg)
errRe := regexp.MustCompile("one of `((website.0.main_page_suffix,website.0.not_found_page)|(website.0.not_found_page,website.0.main_page_suffix))` must be specified")

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -863,7 +859,7 @@ func TestAccStorageBucket_website(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccStorageBucket_websiteNoAttributes(bucketSuffix),
ExpectError: regexp.MustCompile(fullErr),
ExpectError: errRe,
},
{
Config: testAccStorageBucket_websiteOneAttribute(bucketSuffix),
Expand Down

0 comments on commit 4e126d7

Please sign in to comment.