MCPcopy Create free account
hub / github.com/cli/cli / stubContentsAPI

Function stubContentsAPI

pkg/cmd/skills/install/install_test.go:2716–2722  ·  view source on GitHub ↗
(reg *httpmock.Registry, owner, repo, path, content string)

Source from the content-addressed store, hash-verified

2714`)
2715
2716func stubContentsAPI(reg *httpmock.Registry, owner, repo, path, content string) {
2717 encoded := base64.StdEncoding.EncodeToString([]byte(content))
2718 reg.Register(
2719 httpmock.REST("GET", fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, url.PathEscape(path))),
2720 httpmock.StringResponse(fmt.Sprintf(`{"content": %q, "encoding": "base64"}`, encoded)),
2721 )
2722}
2723
2724func TestInstallRun_UpstreamDetection(t *testing.T) {
2725 tests := []struct {

Callers 1

Calls 3

RESTFunction · 0.92
StringResponseFunction · 0.92
RegisterMethod · 0.45

Tested by

no test coverage detected