Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
annabarnes1138 committed May 26, 2021
1 parent 75a468d commit e599f1d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/releaser/releaser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ func (m *MockClient) Get(url string) (*http.Response, error) {
}
}

func (m *MockClient) GetWithToken(url string, token string) (*http.Response, error) {
if m.statusCode == http.StatusOK {
file, _ := os.Open(m.file)
reader := bufio.NewReader(file)
return &http.Response{StatusCode: http.StatusOK, Body: ioutil.NopCloser(reader)}, nil
} else {
return &http.Response{StatusCode: http.StatusNotFound, Body: ioutil.NopCloser(nil)}, nil
}
}

func (f *FakeGitHub) CreateRelease(ctx context.Context, input *github.Release) error {
f.Called(ctx, input)
f.release = input
Expand Down

0 comments on commit e599f1d

Please sign in to comment.