1
0
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:
Nick Craig-Wood
2018-03-19 15:51:38 +00:00
parent 940df88eb2
commit d64789528d
4309 changed files with 1327278 additions and 1001118 deletions

View File

@@ -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)
}
}
}