Complete get -> list renaming

This commit is contained in:
Michael Hoffman 2024-12-28 07:51:47 -05:00
parent da826db342
commit fa254ba205

View file

@ -11,13 +11,7 @@ import (
"github.com/stretchr/testify/require"
)
func TestNewAutolinkGetter(t *testing.T) {
httpClient := &http.Client{}
autolinkGetter := &AutolinkLister{HTTPClient: httpClient}
assert.NotNil(t, autolinkGetter)
}
func TestAutoLinkGetter_Get(t *testing.T) {
func TestAutoLinkLister_List(t *testing.T) {
tests := []struct {
name string
repo ghrepo.Interface
@ -65,10 +59,10 @@ func TestAutoLinkGetter_Get(t *testing.T) {
)
defer reg.Verify(t)
autolinkGetter := &AutolinkLister{
autolinkLister := &AutolinkLister{
HTTPClient: &http.Client{Transport: reg},
}
autolinks, err := autolinkGetter.List(tt.repo)
autolinks, err := autolinkLister.List(tt.repo)
if tt.status == 404 {
require.Error(t, err)
assert.Equal(t, "error getting autolinks: HTTP 404: Perhaps you are missing admin rights to the repository? (https://api.github.com/repos/OWNER/REPO/autolinks)", err.Error())