mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-05 14:28:54 +00:00
Update go-github library
This commit is contained in:
37
vendor/github.com/google/go-github/github/gists_comments_test.go
generated
vendored
37
vendor/github.com/google/go-github/github/gists_comments_test.go
generated
vendored
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user