Fix tests
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
parent
112f7f0370
commit
d65358b6cc
5 changed files with 95 additions and 131 deletions
14
post.go
14
post.go
|
@ -497,7 +497,7 @@ func addCommentToTree(pc *PostAndComments, comment *Comment) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *PostService) random(ctx context.Context, subreddits ...string) (*Post, []*Comment, *Response, error) {
|
func (s *PostService) random(ctx context.Context, subreddits ...string) (*PostAndComments, *Response, error) {
|
||||||
path := "random"
|
path := "random"
|
||||||
if len(subreddits) > 0 {
|
if len(subreddits) > 0 {
|
||||||
path = fmt.Sprintf("r/%s/random", strings.Join(subreddits, "+"))
|
path = fmt.Sprintf("r/%s/random", strings.Join(subreddits, "+"))
|
||||||
|
@ -505,30 +505,30 @@ func (s *PostService) random(ctx context.Context, subreddits ...string) (*Post,
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
root := new(PostAndComments)
|
root := new(PostAndComments)
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
resp, err := s.client.Do(ctx, req, root)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return root.Post, root.Comments, resp, nil
|
return root, resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// RandomFromSubreddits returns a random post and its comments from the subreddits.
|
// RandomFromSubreddits returns a random post and its comments from the subreddits.
|
||||||
// If no subreddits are provided, Reddit runs the query against your subscriptions.
|
// If no subreddits are provided, Reddit runs the query against your subscriptions.
|
||||||
func (s *PostService) RandomFromSubreddits(ctx context.Context, subreddits ...string) (*Post, []*Comment, *Response, error) {
|
func (s *PostService) RandomFromSubreddits(ctx context.Context, subreddits ...string) (*PostAndComments, *Response, error) {
|
||||||
return s.random(ctx, subreddits...)
|
return s.random(ctx, subreddits...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Random returns a random post and its comments from all of Reddit.
|
// Random returns a random post and its comments from all of Reddit.
|
||||||
func (s *PostService) Random(ctx context.Context) (*Post, []*Comment, *Response, error) {
|
func (s *PostService) Random(ctx context.Context) (*PostAndComments, *Response, error) {
|
||||||
return s.random(ctx, "all")
|
return s.random(ctx, "all")
|
||||||
}
|
}
|
||||||
|
|
||||||
// RandomFromSubscriptions returns a random post and its comments from your subscriptions.
|
// RandomFromSubscriptions returns a random post and its comments from your subscriptions.
|
||||||
func (s *PostService) RandomFromSubscriptions(ctx context.Context) (*Post, []*Comment, *Response, error) {
|
func (s *PostService) RandomFromSubscriptions(ctx context.Context) (*PostAndComments, *Response, error) {
|
||||||
return s.random(ctx)
|
return s.random(ctx)
|
||||||
}
|
}
|
||||||
|
|
157
post_test.go
157
post_test.go
|
@ -10,84 +10,85 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
var expectedPost2 = &Post{
|
var expectedPostAndComments = &PostAndComments{
|
||||||
ID: "testpost",
|
Post: &Post{
|
||||||
FullID: "t3_testpost",
|
ID: "testpost",
|
||||||
Created: &Timestamp{time.Date(2020, 7, 18, 10, 26, 7, 0, time.UTC)},
|
FullID: "t3_testpost",
|
||||||
Edited: &Timestamp{time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC)},
|
Created: &Timestamp{time.Date(2020, 7, 18, 10, 26, 7, 0, time.UTC)},
|
||||||
|
|
||||||
Permalink: Permalink("https://www.reddit.com/r/test/comments/testpost/test/"),
|
|
||||||
URL: "https://www.reddit.com/r/test/comments/testpost/test/",
|
|
||||||
|
|
||||||
Title: "Test",
|
|
||||||
Body: "Hello",
|
|
||||||
|
|
||||||
Score: 1,
|
|
||||||
UpvoteRatio: 1,
|
|
||||||
NumberOfComments: 2,
|
|
||||||
|
|
||||||
SubredditID: "t5_2qh23",
|
|
||||||
SubredditName: "test",
|
|
||||||
SubredditNamePrefixed: "r/test",
|
|
||||||
|
|
||||||
AuthorID: "t2_testuser",
|
|
||||||
AuthorName: "testuser",
|
|
||||||
|
|
||||||
IsSelfPost: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
var expectedComments = []*Comment{
|
|
||||||
{
|
|
||||||
ID: "testc1",
|
|
||||||
FullID: "t1_testc1",
|
|
||||||
Created: &Timestamp{time.Date(2020, 7, 18, 10, 31, 59, 0, time.UTC)},
|
|
||||||
Edited: &Timestamp{time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC)},
|
Edited: &Timestamp{time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC)},
|
||||||
|
|
||||||
ParentID: "t3_testpost",
|
Permalink: Permalink("https://www.reddit.com/r/test/comments/testpost/test/"),
|
||||||
Permalink: Permalink("https://www.reddit.com/r/test/comments/testpost/test/testc1/"),
|
URL: "https://www.reddit.com/r/test/comments/testpost/test/",
|
||||||
|
|
||||||
Body: "Hi",
|
Title: "Test",
|
||||||
Author: "testuser",
|
Body: "Hello",
|
||||||
AuthorID: "t2_testuser",
|
|
||||||
|
|
||||||
Subreddit: "test",
|
|
||||||
SubredditNamePrefixed: "r/test",
|
|
||||||
SubredditID: "t5_2qh23",
|
|
||||||
|
|
||||||
Score: 1,
|
Score: 1,
|
||||||
Controversiality: 0,
|
UpvoteRatio: 1,
|
||||||
|
NumberOfComments: 2,
|
||||||
|
|
||||||
PostID: "t3_testpost",
|
SubredditID: "t5_2qh23",
|
||||||
|
SubredditName: "test",
|
||||||
|
SubredditNamePrefixed: "r/test",
|
||||||
|
|
||||||
IsSubmitter: true,
|
AuthorID: "t2_testuser",
|
||||||
CanGild: true,
|
AuthorName: "testuser",
|
||||||
|
|
||||||
Replies: Replies{
|
IsSelfPost: true,
|
||||||
Comments: []*Comment{
|
},
|
||||||
{
|
Comments: []*Comment{
|
||||||
ID: "testc2",
|
{
|
||||||
FullID: "t1_testc2",
|
ID: "testc1",
|
||||||
Created: &Timestamp{time.Date(2020, 7, 18, 10, 32, 28, 0, time.UTC)},
|
FullID: "t1_testc1",
|
||||||
Edited: &Timestamp{time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC)},
|
Created: &Timestamp{time.Date(2020, 7, 18, 10, 31, 59, 0, time.UTC)},
|
||||||
|
Edited: &Timestamp{time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC)},
|
||||||
|
|
||||||
ParentID: "t1_testc1",
|
ParentID: "t3_testpost",
|
||||||
Permalink: Permalink("https://www.reddit.com/r/test/comments/testpost/test/testc2/"),
|
Permalink: Permalink("https://www.reddit.com/r/test/comments/testpost/test/testc1/"),
|
||||||
|
|
||||||
Body: "Hello",
|
Body: "Hi",
|
||||||
Author: "testuser",
|
Author: "testuser",
|
||||||
AuthorID: "t2_testuser",
|
AuthorID: "t2_testuser",
|
||||||
|
|
||||||
Subreddit: "test",
|
Subreddit: "test",
|
||||||
SubredditNamePrefixed: "r/test",
|
SubredditNamePrefixed: "r/test",
|
||||||
SubredditID: "t5_2qh23",
|
SubredditID: "t5_2qh23",
|
||||||
|
|
||||||
Score: 1,
|
Score: 1,
|
||||||
Controversiality: 0,
|
Controversiality: 0,
|
||||||
|
|
||||||
PostID: "t3_testpost",
|
PostID: "t3_testpost",
|
||||||
|
|
||||||
IsSubmitter: true,
|
IsSubmitter: true,
|
||||||
CanGild: true,
|
CanGild: true,
|
||||||
|
|
||||||
|
Replies: Replies{
|
||||||
|
Comments: []*Comment{
|
||||||
|
{
|
||||||
|
ID: "testc2",
|
||||||
|
FullID: "t1_testc2",
|
||||||
|
Created: &Timestamp{time.Date(2020, 7, 18, 10, 32, 28, 0, time.UTC)},
|
||||||
|
Edited: &Timestamp{time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC)},
|
||||||
|
|
||||||
|
ParentID: "t1_testc1",
|
||||||
|
Permalink: Permalink("https://www.reddit.com/r/test/comments/testpost/test/testc2/"),
|
||||||
|
|
||||||
|
Body: "Hello",
|
||||||
|
Author: "testuser",
|
||||||
|
AuthorID: "t2_testuser",
|
||||||
|
|
||||||
|
Subreddit: "test",
|
||||||
|
SubredditNamePrefixed: "r/test",
|
||||||
|
SubredditID: "t5_2qh23",
|
||||||
|
|
||||||
|
Score: 1,
|
||||||
|
Controversiality: 0,
|
||||||
|
|
||||||
|
PostID: "t3_testpost",
|
||||||
|
|
||||||
|
IsSubmitter: true,
|
||||||
|
CanGild: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -141,10 +142,9 @@ func TestPostService_Get(t *testing.T) {
|
||||||
fmt.Fprint(w, blob)
|
fmt.Fprint(w, blob)
|
||||||
})
|
})
|
||||||
|
|
||||||
post, comments, _, err := client.Post.Get(ctx, "test")
|
postAndComments, _, err := client.Post.Get(ctx, "test")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, expectedPost2, post)
|
assert.Equal(t, expectedPostAndComments, postAndComments)
|
||||||
assert.Equal(t, expectedComments, comments)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPostService_SubmitText(t *testing.T) {
|
func TestPostService_SubmitText(t *testing.T) {
|
||||||
|
@ -741,7 +741,7 @@ func TestPostService_More(t *testing.T) {
|
||||||
fmt.Fprint(w, blob)
|
fmt.Fprint(w, blob)
|
||||||
})
|
})
|
||||||
|
|
||||||
_, err = client.Post.More(ctx, parentComment)
|
_, err = client.Comment.LoadMoreReplies(ctx, parentComment)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Nil(t, parentComment.Replies.MoreComments)
|
assert.Nil(t, parentComment.Replies.MoreComments)
|
||||||
assert.Len(t, parentComment.Replies.Comments, 1)
|
assert.Len(t, parentComment.Replies.Comments, 1)
|
||||||
|
@ -752,7 +752,7 @@ func TestPostService_MoreNil(t *testing.T) {
|
||||||
setup()
|
setup()
|
||||||
defer teardown()
|
defer teardown()
|
||||||
|
|
||||||
_, err := client.Post.More(ctx, nil)
|
_, err := client.Comment.LoadMoreReplies(ctx, nil)
|
||||||
assert.EqualError(t, err, "comment: must not be nil")
|
assert.EqualError(t, err, "comment: must not be nil")
|
||||||
|
|
||||||
parentComment := &Comment{
|
parentComment := &Comment{
|
||||||
|
@ -762,7 +762,7 @@ func TestPostService_MoreNil(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// should return nil, nil since comment does not have More struct
|
// should return nil, nil since comment does not have More struct
|
||||||
resp, err := client.Post.More(ctx, parentComment)
|
resp, err := client.Comment.LoadMoreReplies(ctx, parentComment)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Nil(t, resp)
|
assert.Nil(t, resp)
|
||||||
|
|
||||||
|
@ -771,7 +771,7 @@ func TestPostService_MoreNil(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// should return nil, nil since comment's More struct has 0 children
|
// should return nil, nil since comment's More struct has 0 children
|
||||||
resp, err = client.Post.More(ctx, parentComment)
|
resp, err = client.Comment.LoadMoreReplies(ctx, parentComment)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Nil(t, resp)
|
assert.Nil(t, resp)
|
||||||
}
|
}
|
||||||
|
@ -788,10 +788,9 @@ func TestPostService_RandomFromSubreddits(t *testing.T) {
|
||||||
fmt.Fprint(w, blob)
|
fmt.Fprint(w, blob)
|
||||||
})
|
})
|
||||||
|
|
||||||
post, comments, _, err := client.Post.RandomFromSubreddits(ctx, "test")
|
postAndComments, _, err := client.Post.RandomFromSubreddits(ctx, "test")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, expectedPost2, post)
|
assert.Equal(t, expectedPostAndComments, postAndComments)
|
||||||
assert.Equal(t, expectedComments, comments)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPostService_Random(t *testing.T) {
|
func TestPostService_Random(t *testing.T) {
|
||||||
|
@ -806,10 +805,9 @@ func TestPostService_Random(t *testing.T) {
|
||||||
fmt.Fprint(w, blob)
|
fmt.Fprint(w, blob)
|
||||||
})
|
})
|
||||||
|
|
||||||
post, comments, _, err := client.Post.Random(ctx)
|
postAndComments, _, err := client.Post.Random(ctx)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, expectedPost2, post)
|
assert.Equal(t, expectedPostAndComments, postAndComments)
|
||||||
assert.Equal(t, expectedComments, comments)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPostService_RandomFromSubscriptions(t *testing.T) {
|
func TestPostService_RandomFromSubscriptions(t *testing.T) {
|
||||||
|
@ -824,10 +822,9 @@ func TestPostService_RandomFromSubscriptions(t *testing.T) {
|
||||||
fmt.Fprint(w, blob)
|
fmt.Fprint(w, blob)
|
||||||
})
|
})
|
||||||
|
|
||||||
post, comments, _, err := client.Post.RandomFromSubscriptions(ctx)
|
postAndComments, _, err := client.Post.RandomFromSubscriptions(ctx)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, expectedPost2, post)
|
assert.Equal(t, expectedPostAndComments, postAndComments)
|
||||||
assert.Equal(t, expectedComments, comments)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPostService_Delete(t *testing.T) {
|
func TestPostService_Delete(t *testing.T) {
|
||||||
|
|
14
subreddit.go
14
subreddit.go
|
@ -164,12 +164,12 @@ func (s *SubredditService) GetModerated(ctx context.Context, opts *ListOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSticky1 returns the first stickied post on a subreddit (if it exists).
|
// GetSticky1 returns the first stickied post on a subreddit (if it exists).
|
||||||
func (s *SubredditService) GetSticky1(ctx context.Context, name string) (*Post, []*Comment, *Response, error) {
|
func (s *SubredditService) GetSticky1(ctx context.Context, name string) (*PostAndComments, *Response, error) {
|
||||||
return s.getSticky(ctx, name, 1)
|
return s.getSticky(ctx, name, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSticky2 returns the second stickied post on a subreddit (if it exists).
|
// GetSticky2 returns the second stickied post on a subreddit (if it exists).
|
||||||
func (s *SubredditService) GetSticky2(ctx context.Context, name string) (*Post, []*Comment, *Response, error) {
|
func (s *SubredditService) GetSticky2(ctx context.Context, name string) (*PostAndComments, *Response, error) {
|
||||||
return s.getSticky(ctx, name, 2)
|
return s.getSticky(ctx, name, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ func (s *SubredditService) getSubreddits(ctx context.Context, path string, opts
|
||||||
|
|
||||||
// getSticky returns one of the 2 stickied posts of the subreddit (if they exist).
|
// getSticky returns one of the 2 stickied posts of the subreddit (if they exist).
|
||||||
// Num should be equal to 1 or 2, depending on which one you want.
|
// Num should be equal to 1 or 2, depending on which one you want.
|
||||||
func (s *SubredditService) getSticky(ctx context.Context, subreddit string, num int) (*Post, []*Comment, *Response, error) {
|
func (s *SubredditService) getSticky(ctx context.Context, subreddit string, num int) (*PostAndComments, *Response, error) {
|
||||||
type query struct {
|
type query struct {
|
||||||
Num int `url:"num"`
|
Num int `url:"num"`
|
||||||
}
|
}
|
||||||
|
@ -286,21 +286,21 @@ func (s *SubredditService) getSticky(ctx context.Context, subreddit string, num
|
||||||
path := fmt.Sprintf("r/%s/about/sticky", subreddit)
|
path := fmt.Sprintf("r/%s/about/sticky", subreddit)
|
||||||
path, err := addOptions(path, query{num})
|
path, err := addOptions(path, query{num})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
req, err := s.client.NewRequest(http.MethodGet, path, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
root := new(PostAndComments)
|
root := new(PostAndComments)
|
||||||
resp, err := s.client.Do(ctx, req, root)
|
resp, err := s.client.Do(ctx, req, root)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return root.Post, root.Comments, resp, nil
|
return root, resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Moderators returns the moderators of a subreddit.
|
// Moderators returns the moderators of a subreddit.
|
||||||
|
|
|
@ -140,35 +140,6 @@ var expectedSubreddits = &Subreddits{
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var expectedSticky = &postAndComments{
|
|
||||||
Post: &Post{
|
|
||||||
ID: "hcl9gq",
|
|
||||||
FullID: "t3_hcl9gq",
|
|
||||||
Created: &Timestamp{time.Date(2020, 6, 20, 12, 8, 57, 0, time.UTC)},
|
|
||||||
Edited: &Timestamp{time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC)},
|
|
||||||
|
|
||||||
Permalink: "https://www.reddit.com/r/nba/comments/hcl9gq/daily_discussion_thread_freetalk_and_other/",
|
|
||||||
URL: "https://www.reddit.com/r/nba/comments/hcl9gq/daily_discussion_thread_freetalk_and_other/",
|
|
||||||
|
|
||||||
Title: "Daily Discussion Thread | Free-Talk and Other Updates - June 20, 2020",
|
|
||||||
Body: "Talk about whatever is on your mind, basketball related or not.\n\n# Useful Links \u0026amp; Other Resources\n\n[List of All #NBATogether Live Classic Games Streamed to Date](https://www.youtube.com/results?search_query=%23NBATogetherLive)\n\n[r/nba Discord Server](https://www.discord.gg/nba)\n\n[r/nba Twitter](https://twitter.com/nba_reddit)\n\n[Read Our Community's Rules and Guidelines](https://www.reddit.com/r/nba/wiki/rules)",
|
|
||||||
|
|
||||||
Score: 16,
|
|
||||||
UpvoteRatio: 0.82,
|
|
||||||
NumberOfComments: 25,
|
|
||||||
|
|
||||||
SubredditID: "t5_2qo4s",
|
|
||||||
SubredditName: "nba",
|
|
||||||
SubredditNamePrefixed: "r/nba",
|
|
||||||
|
|
||||||
AuthorID: "t2_6l4z3",
|
|
||||||
AuthorName: "AutoModerator",
|
|
||||||
|
|
||||||
IsSelfPost: true,
|
|
||||||
Stickied: true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
var expectSubredditInfos = []*SubredditInfo{
|
var expectSubredditInfos = []*SubredditInfo{
|
||||||
{Name: "golang", Subscribers: 119_722, ActiveUsers: 531},
|
{Name: "golang", Subscribers: 119_722, ActiveUsers: 531},
|
||||||
{Name: "golang_infosec", Subscribers: 1_776, ActiveUsers: 0},
|
{Name: "golang_infosec", Subscribers: 1_776, ActiveUsers: 0},
|
||||||
|
@ -449,10 +420,9 @@ func TestSubredditService_GetSticky1(t *testing.T) {
|
||||||
fmt.Fprint(w, blob)
|
fmt.Fprint(w, blob)
|
||||||
})
|
})
|
||||||
|
|
||||||
post, comments, _, err := client.Subreddit.GetSticky1(ctx, "test")
|
postAndComments, _, err := client.Subreddit.GetSticky1(ctx, "test")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, expectedPost2, post)
|
assert.Equal(t, expectedPostAndComments, postAndComments)
|
||||||
assert.Equal(t, expectedComments, comments)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSubredditService_GetSticky2(t *testing.T) {
|
func TestSubredditService_GetSticky2(t *testing.T) {
|
||||||
|
@ -472,10 +442,9 @@ func TestSubredditService_GetSticky2(t *testing.T) {
|
||||||
fmt.Fprint(w, blob)
|
fmt.Fprint(w, blob)
|
||||||
})
|
})
|
||||||
|
|
||||||
post, comments, _, err := client.Subreddit.GetSticky2(ctx, "test")
|
postAndComments, _, err := client.Subreddit.GetSticky2(ctx, "test")
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, expectedPost2, post)
|
assert.Equal(t, expectedPostAndComments, postAndComments)
|
||||||
assert.Equal(t, expectedComments, comments)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSubredditService_Subscribe(t *testing.T) {
|
func TestSubredditService_Subscribe(t *testing.T) {
|
||||||
|
|
|
@ -447,5 +447,3 @@ func (pc *PostAndComments) UnmarshalJSON(data []byte) error {
|
||||||
func (pc *PostAndComments) hasMore() bool {
|
func (pc *PostAndComments) hasMore() bool {
|
||||||
return pc.moreComments != nil && len(pc.moreComments.Children) > 0
|
return pc.moreComments != nil && len(pc.moreComments.Children) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pc *PostAndComments) M() *More { return pc.moreComments }
|
|
||||||
|
|
Loading…
Reference in a new issue