Skip to content

Commit 5a59f6e

Browse files
Fix error regexp for storage bucket website test (#5427)
Signed-off-by: Modular Magician <[email protected]> Co-authored-by: emily <[email protected]>
1 parent aab7402 commit 5a59f6e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

google/resource_storage_bucket_test.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"log"
77
"regexp"
8-
"strings"
98
"testing"
109
"time"
1110

@@ -851,10 +850,7 @@ func TestAccStorageBucket_website(t *testing.T) {
851850
t.Parallel()
852851

853852
bucketSuffix := acctest.RandomWithPrefix("tf-website-test")
854-
855-
websiteKeys := []string{"website.0.main_page_suffix", "website.0.not_found_page"}
856-
errMsg := fmt.Sprintf("one of `%s` must be specified", strings.Join(websiteKeys, ","))
857-
fullErr := fmt.Sprintf("config is invalid: 2 problems:\n\n- \"%s\": %s\n- \"%s\": %s", websiteKeys[0], errMsg, websiteKeys[1], errMsg)
853+
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")
858854

859855
resource.Test(t, resource.TestCase{
860856
PreCheck: func() { testAccPreCheck(t) },
@@ -863,7 +859,7 @@ func TestAccStorageBucket_website(t *testing.T) {
863859
Steps: []resource.TestStep{
864860
{
865861
Config: testAccStorageBucket_websiteNoAttributes(bucketSuffix),
866-
ExpectError: regexp.MustCompile(fullErr),
862+
ExpectError: errRe,
867863
},
868864
{
869865
Config: testAccStorageBucket_websiteOneAttribute(bucketSuffix),

0 commit comments

Comments
 (0)