Update go-github library

This commit is contained in:
Luke Kysow
2018-12-12 09:55:17 -06:00
parent e001353ae9
commit 139f05ab49
170 changed files with 14305 additions and 3086 deletions

View File

@@ -15,7 +15,7 @@ import (
)
func TestGistsService_ListComments(t *testing.T) {
setup()
client, mux, _, teardown := setup()
defer teardown()
mux.HandleFunc("/gists/1/comments", func(w http.ResponseWriter, r *http.Request) {
@@ -30,19 +30,22 @@ func TestGistsService_ListComments(t *testing.T) {
t.Errorf("Gists.Comments returned error: %v", err)
}
want := []*GistComment{{ID: Int(1)}}
want := []*GistComment{{ID: Int64(1)}}
if !reflect.DeepEqual(comments, want) {
t.Errorf("Gists.ListComments returned %+v, want %+v", comments, want)
}
}
func TestGistsService_ListComments_invalidID(t *testing.T) {
client, _, _, teardown := setup()
defer teardown()
_, _, err := client.Gists.ListComments(context.Background(), "%", nil)
testURLParseError(t, err)
}
func TestGistsService_GetComment(t *testing.T) {
setup()
client, mux, _, teardown := setup()
defer teardown()
mux.HandleFunc("/gists/1/comments/2", func(w http.ResponseWriter, r *http.Request) {
@@ -55,22 +58,25 @@ func TestGistsService_GetComment(t *testing.T) {
t.Errorf("Gists.GetComment returned error: %v", err)
}
want := &GistComment{ID: Int(1)}
want := &GistComment{ID: Int64(1)}
if !reflect.DeepEqual(comment, want) {
t.Errorf("Gists.GetComment returned %+v, want %+v", comment, want)
}
}
func TestGistsService_GetComment_invalidID(t *testing.T) {
client, _, _, teardown := setup()
defer teardown()
_, _, err := client.Gists.GetComment(context.Background(), "%", 1)
testURLParseError(t, err)
}
func TestGistsService_CreateComment(t *testing.T) {
setup()
client, mux, _, teardown := setup()
defer teardown()
input := &GistComment{ID: Int(1), Body: String("b")}
input := &GistComment{ID: Int64(1), Body: String("b")}
mux.HandleFunc("/gists/1/comments", func(w http.ResponseWriter, r *http.Request) {
v := new(GistComment)
@@ -89,22 +95,25 @@ func TestGistsService_CreateComment(t *testing.T) {
t.Errorf("Gists.CreateComment returned error: %v", err)
}
want := &GistComment{ID: Int(1)}
want := &GistComment{ID: Int64(1)}
if !reflect.DeepEqual(comment, want) {
t.Errorf("Gists.CreateComment returned %+v, want %+v", comment, want)
}
}
func TestGistsService_CreateComment_invalidID(t *testing.T) {
client, _, _, teardown := setup()
defer teardown()
_, _, err := client.Gists.CreateComment(context.Background(), "%", nil)
testURLParseError(t, err)
}
func TestGistsService_EditComment(t *testing.T) {
setup()
client, mux, _, teardown := setup()
defer teardown()
input := &GistComment{ID: Int(1), Body: String("b")}
input := &GistComment{ID: Int64(1), Body: String("b")}
mux.HandleFunc("/gists/1/comments/2", func(w http.ResponseWriter, r *http.Request) {
v := new(GistComment)
@@ -123,19 +132,22 @@ func TestGistsService_EditComment(t *testing.T) {
t.Errorf("Gists.EditComment returned error: %v", err)
}
want := &GistComment{ID: Int(1)}
want := &GistComment{ID: Int64(1)}
if !reflect.DeepEqual(comment, want) {
t.Errorf("Gists.EditComment returned %+v, want %+v", comment, want)
}
}
func TestGistsService_EditComment_invalidID(t *testing.T) {
client, _, _, teardown := setup()
defer teardown()
_, _, err := client.Gists.EditComment(context.Background(), "%", 1, nil)
testURLParseError(t, err)
}
func TestGistsService_DeleteComment(t *testing.T) {
setup()
client, mux, _, teardown := setup()
defer teardown()
mux.HandleFunc("/gists/1/comments/2", func(w http.ResponseWriter, r *http.Request) {
@@ -149,6 +161,9 @@ func TestGistsService_DeleteComment(t *testing.T) {
}
func TestGistsService_DeleteComment_invalidID(t *testing.T) {
client, _, _, teardown := setup()
defer teardown()
_, err := client.Gists.DeleteComment(context.Background(), "%", 1)
testURLParseError(t, err)
}