<commit_before>package google

import (
	"bytes"
	"fmt"
	"math/rand"
	"testing"
	"time"

	"github.com/hashicorp/terraform/helper/resource"
	"github.com/hashicorp/terraform/terraform"

	"google.golang.org/api/googleapi"
	storage "google.golang.org/api/storage/v1"
)

func TestAccStorage_basic(t *testing.T) {
	var bucketName string

	resource.Test(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccGoogleStorageDestroy,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testGoogleStorageBucketsReaderDefaults,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckCloudStorageBucketExists(
						"google_storage_bucket.bucket", &bucketName),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "predefined_acl", "projectPrivate"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "location", "US"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "force_destroy", "false"),
				),
			},
		},
	})
}

func TestAccStorageCustomAttributes(t *testing.T) {
	var bucketName string

	resource.Test(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccGoogleStorageDestroy,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testGoogleStorageBucketsReaderCustomAttributes,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckCloudStorageBucketExists(
						"google_storage_bucket.bucket", &bucketName),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "predefined_acl", "publicReadWrite"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "location", "EU"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "force_destroy", "true"),
				),
			},
		},
	})
}

func TestAccStorageBucketUpdate(t *testing.T) {
	var bucketName string

	resource.Test(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccGoogleStorageDestroy,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testGoogleStorageBucketsReaderDefaults,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckCloudStorageBucketExists(
						"google_storage_bucket.bucket", &bucketName),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "predefined_acl", "projectPrivate"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "location", "US"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "force_destroy", "false"),
				),
			},
			resource.TestStep{
				Config: testGoogleStorageBucketsReaderCustomAttributes,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckCloudStorageBucketExists(
						"google_storage_bucket.bucket", &bucketName),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "predefined_acl", "publicReadWrite"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "location", "EU"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "force_destroy", "true"),
				),
			},
		},<commit_msg>provider/google: storage bucket tests shouldn't not check predefined_acl<commit_after>package google

import (
	"bytes"
	"fmt"
	"math/rand"
	"testing"
	"time"

	"github.com/hashicorp/terraform/helper/resource"
	"github.com/hashicorp/terraform/terraform"

	"google.golang.org/api/googleapi"
	storage "google.golang.org/api/storage/v1"
)

func TestAccStorage_basic(t *testing.T) {
	var bucketName string

	resource.Test(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccGoogleStorageDestroy,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testGoogleStorageBucketsReaderDefaults,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckCloudStorageBucketExists(
						"google_storage_bucket.bucket", &bucketName),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "predefined_acl", "projectPrivate"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "location", "US"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "force_destroy", "false"),
				),
			},
		},
	})
}

func TestAccStorageCustomAttributes(t *testing.T) {
	var bucketName string

	resource.Test(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccGoogleStorageDestroy,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testGoogleStorageBucketsReaderCustomAttributes,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckCloudStorageBucketExists(
						"google_storage_bucket.bucket", &bucketName),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "location", "EU"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "force_destroy", "true"),
				),
			},
		},
	})
}

func TestAccStorageBucketUpdate(t *testing.T) {
	var bucketName string

	resource.Test(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccGoogleStorageDestroy,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testGoogleStorageBucketsReaderDefaults,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckCloudStorageBucketExists(
						"google_storage_bucket.bucket", &bucketName),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "location", "US"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "force_destroy", "false"),
				),
			},
			resource.TestStep{
				Config: testGoogleStorageBucketsReaderCustomAttributes,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckCloudStorageBucketExists(
						"google_storage_bucket.bucket", &bucketName),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "predefined_acl", "publicReadWrite"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "location", "EU"),
					resource.TestCheckResourceAttr(
						"google_storage_bucket.bucket", "force_destroy", "true"),
				),
			},
		},
{'fraction_non_alphanumeric': 0.1125, 'fraction_numerical': 0.00031645569620253165, 'mean_word_length': 4.76207839562443, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3830898', 'n_tokens_mistral': 2329, 'n_tokens_neox': 1894, 'n_words': 287}