mirror of
https://github.com/rclone/rclone.git
synced 2025-08-25 04:16:12 +02:00
vendor: update all dependencies
This commit is contained in:
24
vendor/golang.org/x/oauth2/internal/token_test.go
generated
vendored
24
vendor/golang.org/x/oauth2/internal/token_test.go
generated
vendored
@@ -79,3 +79,27 @@ func TestProviderAuthHeaderWorksDomain(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRetrieveTokenWithContexts(t *testing.T) {
|
||||
const clientID = "client-id"
|
||||
|
||||
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}))
|
||||
defer ts.Close()
|
||||
|
||||
_, err := RetrieveToken(context.Background(), clientID, "", ts.URL, url.Values{})
|
||||
if err != nil {
|
||||
t.Errorf("RetrieveToken (with background context) = %v; want no error", err)
|
||||
}
|
||||
|
||||
ctx, cancelfunc := context.WithCancel(context.Background())
|
||||
|
||||
cancellingts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
cancelfunc()
|
||||
}))
|
||||
defer cancellingts.Close()
|
||||
|
||||
_, err = RetrieveToken(ctx, clientID, "", cancellingts.URL, url.Values{})
|
||||
if err == nil {
|
||||
t.Errorf("RetrieveToken (with cancelled context) = nil; want error")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user