Documentation
¶
Index ¶
Constants ¶
View Source
const UpdateCassettesEnvVariable = "PACKER_UPDATE_CASSETTES"
Variables ¶
View Source
var QueryMatcherIgnore = []string{
"project_id",
"project",
}
QueryMatcherIgnore is a list of query parameters that should be ignored when matching cassettes requests
View Source
var UpdateCassettes = os.Getenv(UpdateCassettesEnvVariable) == "true"
Functions ¶
func GetHTTPRecorder ¶
func GetHTTPRecorder(cassetteFilePath string, update bool) (client *http.Client, cleanup func(), err error)
GetHTTPRecorder creates a new httpClient that records all HTTP requests in a cassette. This cassette is then replayed whenever tests are executed again. This means that once the requests are recorded in the cassette, no more real HTTP requests must be made to run the tests.
It is important to add a `defer cleanup()` so the given cassette files are correctly closed and saved after the requests.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.