test: fixed tests to use new requestContext
Signed-off-by: SoXX <soxx@fenpa.ws>
This commit is contained in:
parent
6eebc4709a
commit
821462a426
@ -121,14 +121,14 @@ func TestGetFavorites(t *testing.T) {
|
||||
httpmock.RegisterResponder("GET", "https://e621.net/favorites.json", jsonResponser)
|
||||
|
||||
requestContext := model.RequestContext{
|
||||
Client: http.Client{},
|
||||
Host: "https://e621.net",
|
||||
UserAgent: "Go-e621-SDK (@username)",
|
||||
Username: "memo",
|
||||
APIKey: "123456",
|
||||
}
|
||||
|
||||
client := http.Client{}
|
||||
posts, err := GetFavorites(client, requestContext, map[string]string{})
|
||||
posts, err := GetFavorites(requestContext, map[string]string{})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
|
@ -55,14 +55,14 @@ func TestGetPost(t *testing.T) {
|
||||
httpmock.RegisterResponder("GET", "https://e621.net/posts/658415636580.json", jsonResponser)
|
||||
|
||||
requestContext := model.RequestContext{
|
||||
Client: http.Client{},
|
||||
Host: "https://e621.net",
|
||||
UserAgent: "Go-e621-SDK (@username)",
|
||||
Username: "memo",
|
||||
APIKey: "123456",
|
||||
}
|
||||
|
||||
client := http.Client{}
|
||||
post, err := GetPost(client, requestContext, "658415636580")
|
||||
post, err := GetPost(requestContext, "658415636580")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
@ -190,14 +190,14 @@ func TestGetPosts(t *testing.T) {
|
||||
httpmock.RegisterResponder("GET", "https://e621.net/posts.json", jsonResponser)
|
||||
|
||||
requestContext := model.RequestContext{
|
||||
Client: http.Client{},
|
||||
Host: "https://e621.net",
|
||||
UserAgent: "Go-e621-SDK (@username)",
|
||||
Username: "memo",
|
||||
APIKey: "123456",
|
||||
}
|
||||
|
||||
client := http.Client{}
|
||||
posts, err := GetPosts(client, requestContext, map[string]string{})
|
||||
posts, err := GetPosts(requestContext, map[string]string{})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user