{"modulePath":"github.com/unitytech/client-go","version":"v2.0.0+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package testing\n\n## Functions\n\n```go\nfunc MkTmpdir(prefix string) (string, error)\n```\nMkTmpdir creates a temporary directory based upon the prefix passed in. If successful, it returns the temporary directory path. The directory can be deleted with a call to \"os.RemoveAll(...)\". In case of error, it'll return an empty string and the error.\n\n```go\nfunc MkTmpdirOrDie(prefix string) string\n```\nMkTmpdir does the same work as \"MkTmpdir\", except in case of errors, it'll trigger a panic.\n\n## Types\n\n```go\ntype FakeHandler struct {\n\tRequestReceived *http.Request\n\tRequestBody     string\n\tStatusCode      int\n\tResponseBody    string\n\t// For logging - you can use a *testing.T\n\t// This will keep log messages associated with the test.\n\tT LogInterface\n\n\tSkipRequestFn func(verb string, url url.URL) bool\n\t// contains filtered or unexported fields\n}\n```\nFakeHandler is to assist in testing HTTP requests. Notice that FakeHandler is not thread safe and you must not direct traffic to except for the request you want to test. You can do this by hiding it in an http.ServeMux.\n\n```go\nfunc (f *FakeHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)\n```\n\n```go\nfunc (f *FakeHandler) SetResponseBody(responseBody string)\n```\n\n```go\nfunc (f *FakeHandler) ValidateRequest(t TestInterface, expectedPath, expectedMethod string, body *string)\n```\nValidateRequest verifies that FakeHandler received a request with expected path, method, and body.\n\n```go\nfunc (f *FakeHandler) ValidateRequestCount(t TestInterface, count int) bool\n```\n\n```go\ntype LogInterface interface {\n\tLogf(format string, args ...interface{})\n}\n```\nLogInterface is a simple interface to allow injection of Logf to report serving errors.\n\n```go\ntype TestInterface interface {\n\tErrorf(format string, args ...interface{})\n\tLogf(format string, args ...interface{})\n}\n```\nTestInterface is a simple interface providing Errorf, to make injection for testing easier (insert 'yo dawg' meme here).\n\n","path":"github.com/unitytech/client-go/pkg/util/testing","name":"testing","synopsis":"","isRedistributable":true}
