From 6bc1b8c1f647c2473ee109b8744e059d24e8f4d7 Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 17 Jan 2020 11:31:03 -0800 Subject: [PATCH] Fix error regexp for storage bucket website test (#1653) Signed-off-by: Modular Magician Co-authored-by: emily --- google-beta/resource_storage_bucket_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/google-beta/resource_storage_bucket_test.go b/google-beta/resource_storage_bucket_test.go index b3140f2042..ce3a62c1e1 100644 --- a/google-beta/resource_storage_bucket_test.go +++ b/google-beta/resource_storage_bucket_test.go @@ -5,7 +5,6 @@ import ( "fmt" "log" "regexp" - "strings" "testing" "time" @@ -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) }, @@ -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),