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

Function stubContentsAPI

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

Source from the content-addressed store, hash-verified

2877`)
2878
2879func stubContentsAPI(reg *httpmock.Registry, owner, repo, path, content string) {
2880 encoded := base64.StdEncoding.EncodeToString([]byte(content))
2881 reg.Register(
2882 httpmock.REST("GET", fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, url.PathEscape(path))),
2883 httpmock.StringResponse(fmt.Sprintf(`{"content": %q, "encoding": "base64"}`, encoded)),
2884 )
2885}
2886
2887func TestInstallRun_UpstreamDetection(t *testing.T) {
2888 tests := []struct {

Calls 3

RESTFunction · 0.92
StringResponseFunction · 0.92
RegisterMethod · 0.45

Tested by

no test coverage detected