MCPcopy Index your code
hub / github.com/cli/cli / stubDiscoverTree

Function stubDiscoverTree

pkg/cmd/skills/install/install_test.go:229–234  ·  view source on GitHub ↗

stubDiscoverTree registers the single recursive-tree call used by DiscoverSkills.

(reg *httpmock.Registry, owner, repo, sha, treeJSON string)

Source from the content-addressed store, hash-verified

227
228// stubDiscoverTree registers the single recursive-tree call used by DiscoverSkills.
229func stubDiscoverTree(reg *httpmock.Registry, owner, repo, sha, treeJSON string) {
230 reg.Register(
231 httpmock.REST("GET", fmt.Sprintf("repos/%s/%s/git/trees/%s", owner, repo, sha)),
232 httpmock.StringResponse(fmt.Sprintf(`{"sha": %q, "tree": [%s]}`, sha, treeJSON)),
233 )
234}
235
236// stubInstallFiles registers subtree + blob stubs for installer.Install (one skill).
237func stubInstallFiles(reg *httpmock.Registry, owner, repo, treeSHA, blobSHA, content string) {

Calls 3

RESTFunction · 0.92
StringResponseFunction · 0.92
RegisterMethod · 0.45

Tested by

no test coverage detected