stubResolveLatestTag registers API stubs for latest release + tag resolution.
(reg *httpmock.Registry, owner, repo, tag, sha string)
| 228 | |
| 229 | // stubResolveLatestTag registers API stubs for latest release + tag resolution. |
| 230 | func stubResolveLatestTag(reg *httpmock.Registry, owner, repo, tag, sha string) { |
| 231 | reg.Register( |
| 232 | httpmock.REST("GET", fmt.Sprintf("repos/%s/%s/releases/latest", owner, repo)), |
| 233 | httpmock.StringResponse(fmt.Sprintf(`{"tag_name": %q}`, tag)), |
| 234 | ) |
| 235 | reg.Register( |
| 236 | httpmock.REST("GET", fmt.Sprintf("repos/%s/%s/git/ref/tags%%2F%s", owner, repo, tag)), |
| 237 | httpmock.StringResponse(fmt.Sprintf(`{"object": {"sha": %q, "type": "commit"}}`, sha)), |
| 238 | ) |
| 239 | } |
| 240 | |
| 241 | // stubDiscoverTree registers the single recursive-tree call used by DiscoverSkills. |
| 242 | func stubDiscoverTree(reg *httpmock.Registry, owner, repo, sha, treeJSON string) { |
no test coverage detected