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

Function stubDiscoverTree

pkg/cmd/skills/install/install_test.go:248–253  ·  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

246
247// stubDiscoverTree registers the single recursive-tree call used by DiscoverSkills.
248func stubDiscoverTree(reg *httpmock.Registry, owner, repo, sha, treeJSON string) {
249 reg.Register(
250 httpmock.REST("GET", fmt.Sprintf("repos/%s/%s/git/trees/%s", owner, repo, sha)),
251 httpmock.StringResponse(fmt.Sprintf(`{"sha": %q, "tree": [%s]}`, sha, treeJSON)),
252 )
253}
254
255// stubInstallFiles registers subtree + blob stubs for installer.Install (one skill).
256func 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