mirror of
https://github.com/rclone/rclone.git
synced 2025-12-23 03:33:28 +00:00
vendor: update all dependencies
This commit is contained in:
43
vendor/google.golang.org/api/internal/creds_test.go
generated
vendored
43
vendor/google.golang.org/api/internal/creds_test.go
generated
vendored
@@ -85,46 +85,3 @@ const validServiceAccountJSON = `{
|
||||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
||||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/dumba-504%40appspot.gserviceaccount.com"
|
||||
}`
|
||||
|
||||
func TestRefreshTokenTokenSource(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
data []byte
|
||||
wantOK bool
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "empty",
|
||||
data: []byte{},
|
||||
wantOK: false,
|
||||
wantErr: true, // not valid JSON
|
||||
},
|
||||
{
|
||||
name: "non refresh token JSON",
|
||||
data: []byte("{}"),
|
||||
wantOK: false,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "service account JSON",
|
||||
data: []byte(validServiceAccountJSON),
|
||||
wantOK: false,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "valid refresh token JSON",
|
||||
data: []byte(validRefeshTokenJSON),
|
||||
wantOK: true,
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
_, ok, err := refreshTokenTokenSource(context.Background(), tt.data)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("%v: refreshTokenTokenSource() err = %v, wantErr %v", tt.name, err, tt.wantErr)
|
||||
}
|
||||
if ok != tt.wantOK {
|
||||
t.Errorf("%v: refreshTokenTokenSource() ok = %v, want %v", tt.name, ok, tt.wantOK)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user