Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

send_test.go 520 B

123456789101112131415161718192021
  1. // Copyright 2017 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package gensupport
  5. import (
  6. "context"
  7. "net/http"
  8. "testing"
  9. )
  10. func TestSendRequest(t *testing.T) {
  11. // Setting Accept-Encoding should give an error immediately.
  12. req, _ := http.NewRequest("GET", "url", nil)
  13. req.Header.Set("Accept-Encoding", "")
  14. _, err := SendRequest(context.Background(), nil, req)
  15. if err == nil {
  16. t.Error("got nil, want error")
  17. }
  18. }