You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
520 B

  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. }