Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeServer ¶
type FakeServer struct {
// JSONResponse will always be returned (json-encoded) for any request to the server.
JSONResponse interface{}
// PerURLResponse allows test clients to mock out specific URLs that are requested from this server.
// If a URL matches, the resulting json-encoded blob will be returned, rather than JSONResponse.
PerURLResponse map[string]interface{}
// Server is the local in-process server used for faking a service.
Server *httptest.Server
}
FakeServer is a test helper to run local in-process http servers for testing fakes.
func NewFakeServer ¶
func NewFakeServer() *FakeServer
NewFakeServer returns a new *FakeServer. It is up to callers to remember to call FakeServer.Server.Close().
type MockGitilesTransport ¶
MockGitilesTransport is a test support type to mock out request/response pairs.
Click to show internal directories.
Click to hide internal directories.