test: fixed tests to use new requestContext

Signed-off-by: SoXX <soxx@fenpa.ws>
This commit is contained in:
SoXX 2023-10-23 16:06:52 +02:00
parent 6eebc4709a
commit 821462a426
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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