func tearDown() {
	server.Close()
}
teardown closes the test HTTP server.
package octokit
import (
	"fmt"
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"net/url"
	"os"
	"path/filepath"
	"testing"
	"github.com/stretchr/testify/assert"
)
var (
	mux *http.ServeMux
	client *Client
	server *httptest.Server
)
type TestTransport struct {
	http.RoundTripper
	overrideURL *url.URL
}
func (t TestTransport) RoundTrip(req *http.Request) (*http.Response, error) {
	req = cloneRequest(req)
	req.Header.Set("X-Original-Scheme", req.URL.Scheme)
	req.URL.Scheme = t.overrideURL.Scheme
	req.URL.Host = t.overrideURL.Host
	return t.RoundTripper.RoundTrip(req)
}
func cloneRequest(r *http.Request) *http.Request {
	r2 := new(http.Request)
	*r2 = *r
	r2.URL, _ = url.Parse(r.URL.String())
	r2.Header = make(http.Header)
	for k, s := range r.Header {
		r2.Header[k] = s
	}
	return r2
}
func setup() {
	mux = http.NewServeMux()
	server = httptest.NewServer(mux)
	serverURL, _ := url.Parse(server.URL)
	httpClient := http.Client{
		Transport: TestTransport{
			RoundTripper: http.DefaultTransport,
			overrideURL:  serverURL,
		},
	}
	client = NewClientWith(
		gitHubAPIURL,
		userAgent,
		TokenAuth{AccessToken: "token"},
		&httpClient,
	)
}