From 821462a426ed15e8a5ae4a569f369c6702df393d Mon Sep 17 00:00:00 2001 From: SoXX Date: Mon, 23 Oct 2023 16:06:52 +0200 Subject: [PATCH] test: fixed tests to use new requestContext Signed-off-by: SoXX --- pkg/e621/endpoints/favorite_test.go | 4 ++-- pkg/e621/endpoints/post_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/e621/endpoints/favorite_test.go b/pkg/e621/endpoints/favorite_test.go index c25e853..714d718 100644 --- a/pkg/e621/endpoints/favorite_test.go +++ b/pkg/e621/endpoints/favorite_test.go @@ -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 diff --git a/pkg/e621/endpoints/post_test.go b/pkg/e621/endpoints/post_test.go index 2de749a..eac3fcf 100644 --- a/pkg/e621/endpoints/post_test.go +++ b/pkg/e621/endpoints/post_test.go @@ -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