package storage import ( "context" "testing" gcs "cloud.google.com/go/storage" "github.com/stretchr/testify/assert" "google.golang.org/api/option" ) func TestOptions(t *testing.T) { o := bucketOpts{} bucket := "test-bucket" fn := WithBucket(bucket) fn(&o) assert.Equal(t, bucket, o.bucketName, "options bucket name doesnt match input name") so := storageOpts{} client, err := gcs.NewClient(context.Background(), option.WithoutAuthentication()) assert.NoError(t, err) sfn := WithClient(client) sfn(&so) assert.Equal(t, client, so.client, "options client doesnt match input client") } // Borderline useless test that ensures path doesn't change without someone // being aware they did it func TestActionsPath(t *testing.T) { assert.Equal(t, "actions/edge-infra/presubmit/3018302/ci", BasePath("edge-infra", "presubmit", "3018302", "ci")) }