(reg *httpmock.Registry, treeSHA string)
| 314 | } |
| 315 | |
| 316 | func stubTreeAndBlob(reg *httpmock.Registry, treeSHA string) { |
| 317 | reg.Register( |
| 318 | httpmock.REST("GET", fmt.Sprintf("repos/monalisa/octocat-skills/git/trees/%s", treeSHA)), |
| 319 | httpmock.JSONResponse(map[string]interface{}{ |
| 320 | "sha": treeSHA, "truncated": false, |
| 321 | "tree": []map[string]interface{}{ |
| 322 | {"path": "SKILL.md", "type": "blob", "sha": treeSHA + "-blob", "size": 10}, |
| 323 | }, |
| 324 | })) |
| 325 | reg.Register( |
| 326 | httpmock.REST("GET", fmt.Sprintf("repos/monalisa/octocat-skills/git/blobs/%s-blob", treeSHA)), |
| 327 | httpmock.JSONResponse(map[string]interface{}{ |
| 328 | "sha": treeSHA + "-blob", "encoding": "base64", |
| 329 | "content": base64.StdEncoding.EncodeToString([]byte("# Skill")), |
| 330 | })) |
| 331 | } |
| 332 | |
| 333 | func TestInstall(t *testing.T) { |
| 334 | var progressCount atomic.Int32 |
no test coverage detected