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

Function stubContentsAPI

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

Source from the content-addressed store, hash-verified

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

Calls 3

RESTFunction · 0.92
StringResponseFunction · 0.92
RegisterMethod · 0.45

Tested by

no test coverage detected