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