예제 #1
0
// newTestClient will return a new heroku.Client that's configured to interact
// with a instance of the empire HTTP server.
func newTestClient(t testing.TB) (*hooker.Client, *tugboat.Tugboat, *httptest.Server) {
	tug := tugboattest.New(t)

	s := httptest.NewServer(tugboattest.NewServer(tug))
	c := hooker.NewClient(nil)
	c.URL = s.URL
	c.Secret = tugboattest.GitHubSecret

	return c, tug, s
}
예제 #2
0
// newTestClient will return a new heroku.Client that's configured to interact
// with a instance of the empire HTTP server.
func newTestClient(t testing.TB) (*tugboat.Client, *tugboat.Tugboat, *httptest.Server) {
	tug := tugboattest.New(t)

	s := httptest.NewServer(tugboattest.NewServer(tug))
	c := tugboat.NewClient(nil)
	u, err := url.Parse(s.URL)
	if err != nil {
		t.Fatal(err)
	}
	u.User = url.User("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJQcm92aWRlciI6Imhlcm9rdSJ9.HVBoIvRnGKR87odScLnkFWHi4pvSI8V7LJpjh00njBY")
	c.URL = u.String()

	return c, tug, s
}