vendor: update all dependencies to latest versions
This commit is contained in:
+33
-9
@@ -20,7 +20,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
||||
"cloud.google.com/go/internal/pretty"
|
||||
"cloud.google.com/go/internal/testutil"
|
||||
raw "google.golang.org/api/storage/v1"
|
||||
)
|
||||
|
||||
@@ -61,8 +64,10 @@ func TestBucketAttrsToRawBucket(t *testing.T) {
|
||||
}
|
||||
|
||||
attrs.VersioningEnabled = true
|
||||
attrs.RequesterPays = true
|
||||
got = attrs.toRawBucket()
|
||||
want.Versioning = &raw.BucketVersioning{Enabled: true}
|
||||
want.Billing = &raw.BucketBilling{RequesterPays: true}
|
||||
msg, ok, err = pretty.Diff(want, got)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -74,7 +79,10 @@ func TestBucketAttrsToRawBucket(t *testing.T) {
|
||||
|
||||
func TestBucketAttrsToUpdateToRawBucket(t *testing.T) {
|
||||
t.Parallel()
|
||||
au := &BucketAttrsToUpdate{VersioningEnabled: false}
|
||||
au := &BucketAttrsToUpdate{
|
||||
VersioningEnabled: false,
|
||||
RequesterPays: false,
|
||||
}
|
||||
au.SetLabel("a", "foo")
|
||||
au.DeleteLabel("b")
|
||||
au.SetLabel("c", "")
|
||||
@@ -88,6 +96,10 @@ func TestBucketAttrsToUpdateToRawBucket(t *testing.T) {
|
||||
"a": "foo",
|
||||
"c": "",
|
||||
},
|
||||
Billing: &raw.BucketBilling{
|
||||
RequesterPays: false,
|
||||
ForceSendFields: []string{"RequesterPays"},
|
||||
},
|
||||
NullFields: []string{"Labels.b"},
|
||||
}
|
||||
msg, ok, err := pretty.Diff(want, got)
|
||||
@@ -125,7 +137,20 @@ func TestCallBuilders(t *testing.T) {
|
||||
const metagen = 17
|
||||
|
||||
b := c.Bucket("name")
|
||||
bm := b.If(BucketConditions{MetagenerationMatch: metagen})
|
||||
bm := b.If(BucketConditions{MetagenerationMatch: metagen}).UserProject("p")
|
||||
|
||||
equal := func(x, y interface{}) bool {
|
||||
return testutil.Equal(x, y,
|
||||
cmp.AllowUnexported(
|
||||
raw.BucketsGetCall{},
|
||||
raw.BucketsDeleteCall{},
|
||||
raw.BucketsPatchCall{},
|
||||
),
|
||||
cmp.FilterPath(func(p cmp.Path) bool {
|
||||
return p[len(p)-1].Type() == reflect.TypeOf(&raw.Service{})
|
||||
}, cmp.Ignore()),
|
||||
)
|
||||
}
|
||||
|
||||
for i, test := range []struct {
|
||||
callFunc func(*BucketHandle) (interface{}, error)
|
||||
@@ -137,12 +162,12 @@ func TestCallBuilders(t *testing.T) {
|
||||
{
|
||||
func(b *BucketHandle) (interface{}, error) { return b.newGetCall() },
|
||||
rc.Buckets.Get("name").Projection("full"),
|
||||
func(req interface{}) { req.(*raw.BucketsGetCall).IfMetagenerationMatch(metagen) },
|
||||
func(req interface{}) { req.(*raw.BucketsGetCall).IfMetagenerationMatch(metagen).UserProject("p") },
|
||||
},
|
||||
{
|
||||
func(b *BucketHandle) (interface{}, error) { return b.newDeleteCall() },
|
||||
rc.Buckets.Delete("name"),
|
||||
func(req interface{}) { req.(*raw.BucketsDeleteCall).IfMetagenerationMatch(metagen) },
|
||||
func(req interface{}) { req.(*raw.BucketsDeleteCall).IfMetagenerationMatch(metagen).UserProject("p") },
|
||||
},
|
||||
{
|
||||
func(b *BucketHandle) (interface{}, error) {
|
||||
@@ -151,7 +176,7 @@ func TestCallBuilders(t *testing.T) {
|
||||
rc.Buckets.Patch("name", &raw.Bucket{
|
||||
Versioning: &raw.BucketVersioning{Enabled: false, ForceSendFields: []string{"Enabled"}},
|
||||
}).Projection("full"),
|
||||
func(req interface{}) { req.(*raw.BucketsPatchCall).IfMetagenerationMatch(metagen) },
|
||||
func(req interface{}) { req.(*raw.BucketsPatchCall).IfMetagenerationMatch(metagen).UserProject("p") },
|
||||
},
|
||||
} {
|
||||
got, err := test.callFunc(b)
|
||||
@@ -159,17 +184,16 @@ func TestCallBuilders(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
setClientHeader(test.want.Header())
|
||||
if !reflect.DeepEqual(got, test.want) {
|
||||
if !equal(got, test.want) {
|
||||
t.Errorf("#%d: got %#v, want %#v", i, got, test.want)
|
||||
}
|
||||
|
||||
got, err = test.callFunc(bm)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
test.metagenFunc(test.want)
|
||||
if !reflect.DeepEqual(got, test.want) {
|
||||
t.Errorf("#%d: got %#v, want %#v", i, got, test.want)
|
||||
if !equal(got, test.want) {
|
||||
t.Errorf("#%d:\ngot %#v\nwant %#v", i, got, test.want)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user