"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/httpmock/legacy.go" between
gh-cli-1.11.0.tar.gz and gh-cli-1.12.0.tar.gz

About: GitHub CLI is GitHub’s official command line tool.

legacy.go  (gh-cli-1.11.0):legacy.go  (gh-cli-1.12.0)
package httpmock package httpmock
import ( import (
"fmt" "fmt"
"net/http"
"os"
) )
// TODO: clean up methods in this file when there are no more callers // TODO: clean up methods in this file when there are no more callers
func (r *Registry) StubWithFixturePath(status int, fixturePath string) func() {
fixtureFile, err := os.Open(fixturePath)
r.Register(MatchAny, func(req *http.Request) (*http.Response, error) {
if err != nil {
return nil, err
}
return httpResponse(200, req, fixtureFile), nil
})
return func() {
if err == nil {
fixtureFile.Close()
}
}
}
func (r *Registry) StubRepoInfoResponse(owner, repo, branch string) { func (r *Registry) StubRepoInfoResponse(owner, repo, branch string) {
r.Register( r.Register(
GraphQL(`query RepositoryInfo\b`), GraphQL(`query RepositoryInfo\b`),
StringResponse(fmt.Sprintf(` StringResponse(fmt.Sprintf(`
{ "data": { "repository": { { "data": { "repository": {
"id": "REPOID", "id": "REPOID",
"name": "%s", "name": "%s",
"owner": {"login": "%s"}, "owner": {"login": "%s"},
"description": "", "description": "",
"defaultBranchRef": {"name": "%s"}, "defaultBranchRef": {"name": "%s"},
 End of changes. 2 change blocks. 
17 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)