mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-29 17:08:23 +00:00
Update go-github library
This commit is contained in:
37
vendor/github.com/google/go-github/github/issues_comments_test.go
generated
vendored
37
vendor/github.com/google/go-github/github/issues_comments_test.go
generated
vendored
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
func TestIssuesService_ListComments_allIssues(t *testing.T) {
|
||||
setup()
|
||||
client, mux, _, teardown := setup()
|
||||
defer teardown()
|
||||
|
||||
mux.HandleFunc("/repos/o/r/issues/comments", func(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -42,14 +42,14 @@ func TestIssuesService_ListComments_allIssues(t *testing.T) {
|
||||
t.Errorf("Issues.ListComments returned error: %v", err)
|
||||
}
|
||||
|
||||
want := []*IssueComment{{ID: Int(1)}}
|
||||
want := []*IssueComment{{ID: Int64(1)}}
|
||||
if !reflect.DeepEqual(comments, want) {
|
||||
t.Errorf("Issues.ListComments returned %+v, want %+v", comments, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIssuesService_ListComments_specificIssue(t *testing.T) {
|
||||
setup()
|
||||
client, mux, _, teardown := setup()
|
||||
defer teardown()
|
||||
|
||||
mux.HandleFunc("/repos/o/r/issues/1/comments", func(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -63,19 +63,22 @@ func TestIssuesService_ListComments_specificIssue(t *testing.T) {
|
||||
t.Errorf("Issues.ListComments returned error: %v", err)
|
||||
}
|
||||
|
||||
want := []*IssueComment{{ID: Int(1)}}
|
||||
want := []*IssueComment{{ID: Int64(1)}}
|
||||
if !reflect.DeepEqual(comments, want) {
|
||||
t.Errorf("Issues.ListComments returned %+v, want %+v", comments, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIssuesService_ListComments_invalidOwner(t *testing.T) {
|
||||
client, _, _, teardown := setup()
|
||||
defer teardown()
|
||||
|
||||
_, _, err := client.Issues.ListComments(context.Background(), "%", "r", 1, nil)
|
||||
testURLParseError(t, err)
|
||||
}
|
||||
|
||||
func TestIssuesService_GetComment(t *testing.T) {
|
||||
setup()
|
||||
client, mux, _, teardown := setup()
|
||||
defer teardown()
|
||||
|
||||
mux.HandleFunc("/repos/o/r/issues/comments/1", func(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -89,19 +92,22 @@ func TestIssuesService_GetComment(t *testing.T) {
|
||||
t.Errorf("Issues.GetComment returned error: %v", err)
|
||||
}
|
||||
|
||||
want := &IssueComment{ID: Int(1)}
|
||||
want := &IssueComment{ID: Int64(1)}
|
||||
if !reflect.DeepEqual(comment, want) {
|
||||
t.Errorf("Issues.GetComment returned %+v, want %+v", comment, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIssuesService_GetComment_invalidOrg(t *testing.T) {
|
||||
client, _, _, teardown := setup()
|
||||
defer teardown()
|
||||
|
||||
_, _, err := client.Issues.GetComment(context.Background(), "%", "r", 1)
|
||||
testURLParseError(t, err)
|
||||
}
|
||||
|
||||
func TestIssuesService_CreateComment(t *testing.T) {
|
||||
setup()
|
||||
client, mux, _, teardown := setup()
|
||||
defer teardown()
|
||||
|
||||
input := &IssueComment{Body: String("b")}
|
||||
@@ -123,19 +129,22 @@ func TestIssuesService_CreateComment(t *testing.T) {
|
||||
t.Errorf("Issues.CreateComment returned error: %v", err)
|
||||
}
|
||||
|
||||
want := &IssueComment{ID: Int(1)}
|
||||
want := &IssueComment{ID: Int64(1)}
|
||||
if !reflect.DeepEqual(comment, want) {
|
||||
t.Errorf("Issues.CreateComment returned %+v, want %+v", comment, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIssuesService_CreateComment_invalidOrg(t *testing.T) {
|
||||
client, _, _, teardown := setup()
|
||||
defer teardown()
|
||||
|
||||
_, _, err := client.Issues.CreateComment(context.Background(), "%", "r", 1, nil)
|
||||
testURLParseError(t, err)
|
||||
}
|
||||
|
||||
func TestIssuesService_EditComment(t *testing.T) {
|
||||
setup()
|
||||
client, mux, _, teardown := setup()
|
||||
defer teardown()
|
||||
|
||||
input := &IssueComment{Body: String("b")}
|
||||
@@ -157,19 +166,22 @@ func TestIssuesService_EditComment(t *testing.T) {
|
||||
t.Errorf("Issues.EditComment returned error: %v", err)
|
||||
}
|
||||
|
||||
want := &IssueComment{ID: Int(1)}
|
||||
want := &IssueComment{ID: Int64(1)}
|
||||
if !reflect.DeepEqual(comment, want) {
|
||||
t.Errorf("Issues.EditComment returned %+v, want %+v", comment, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIssuesService_EditComment_invalidOwner(t *testing.T) {
|
||||
client, _, _, teardown := setup()
|
||||
defer teardown()
|
||||
|
||||
_, _, err := client.Issues.EditComment(context.Background(), "%", "r", 1, nil)
|
||||
testURLParseError(t, err)
|
||||
}
|
||||
|
||||
func TestIssuesService_DeleteComment(t *testing.T) {
|
||||
setup()
|
||||
client, mux, _, teardown := setup()
|
||||
defer teardown()
|
||||
|
||||
mux.HandleFunc("/repos/o/r/issues/comments/1", func(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -183,6 +195,9 @@ func TestIssuesService_DeleteComment(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIssuesService_DeleteComment_invalidOwner(t *testing.T) {
|
||||
client, _, _, teardown := setup()
|
||||
defer teardown()
|
||||
|
||||
_, err := client.Issues.DeleteComment(context.Background(), "%", "r", 1)
|
||||
testURLParseError(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user