MCPcopy Create free account
hub / github.com/Facets-cloud/flow / withFakeHTTP

Function withFakeHTTP

internal/app/release_test.go:24–29  ·  view source on GitHub ↗

withFakeHTTP swaps httpGetForVersion for the duration of the test.

(t *testing.T, fn func(url string) (*http.Response, error))

Source from the content-addressed store, hash-verified

22
23// withFakeHTTP swaps httpGetForVersion for the duration of the test.
24func withFakeHTTP(t *testing.T, fn func(url string) (*http.Response, error)) {
25 t.Helper()
26 old := httpGetForVersion
27 httpGetForVersion = fn
28 t.Cleanup(func() { httpGetForVersion = old })
29}
30
31// withFlowRoot points $FLOW_ROOT at a tempdir so version-cache writes
32// don't touch the developer's real ~/.flow.

Calls

no outgoing calls

Tested by

no test coverage detected