--- HTTP stub helpers --- stubResolveVersion registers API stubs for latest release + tag resolution.
(reg *httpmock.Registry, owner, repo, tag, sha string)
| 215 | |
| 216 | // stubResolveVersion registers API stubs for latest release + tag resolution. |
| 217 | func stubResolveVersion(reg *httpmock.Registry, owner, repo, tag, sha string) { |
| 218 | reg.Register( |
| 219 | httpmock.REST("GET", fmt.Sprintf("repos/%s/%s/releases/latest", owner, repo)), |
| 220 | httpmock.StringResponse(fmt.Sprintf(`{"tag_name": %q}`, tag)), |
| 221 | ) |
| 222 | reg.Register( |
| 223 | httpmock.REST("GET", fmt.Sprintf("repos/%s/%s/git/ref/tags/%s", owner, repo, tag)), |
| 224 | httpmock.StringResponse(fmt.Sprintf(`{"object": {"sha": %q, "type": "commit"}}`, sha)), |
| 225 | ) |
| 226 | } |
| 227 | |
| 228 | // stubDiscoverTree registers the single recursive-tree call used by DiscoverSkills. |
| 229 | func stubDiscoverTree(reg *httpmock.Registry, owner, repo, sha, treeJSON string) { |
no test coverage detected