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

Function stubDiscoverTree

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

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