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.
 
 
 

21 lines
492 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. "net/http"
  7. "testing"
  8. )
  9. func TestSendRequest(t *testing.T) {
  10. // Setting Accept-Encoding should give an error immediately.
  11. req, _ := http.NewRequest("GET", "url", nil)
  12. req.Header.Set("Accept-Encoding", "")
  13. _, err := SendRequest(nil, nil, req)
  14. if err == nil {
  15. t.Error("got nil, want error")
  16. }
  17. }