refactor: moved http.Client to model.RequestContext
Signed-off-by: SoXX <soxx@fenpa.ws>
This commit is contained in:
parent
bd1f33dced
commit
141a06a5a0
@ -31,14 +31,14 @@ func TestGetTag(t *testing.T) {
|
|||||||
httpmock.RegisterResponder("GET", "https://e621.net/tags/165165.json", jsonResponser)
|
httpmock.RegisterResponder("GET", "https://e621.net/tags/165165.json", jsonResponser)
|
||||||
|
|
||||||
requestContext := model.RequestContext{
|
requestContext := model.RequestContext{
|
||||||
|
Client: http.Client{},
|
||||||
Host: "https://e621.net",
|
Host: "https://e621.net",
|
||||||
UserAgent: "Go-e621-SDK (@username)",
|
UserAgent: "Go-e621-SDK (@username)",
|
||||||
Username: "memo",
|
Username: "memo",
|
||||||
APIKey: "123456",
|
APIKey: "123456",
|
||||||
}
|
}
|
||||||
|
|
||||||
client := http.Client{}
|
tag, err := GetTag(requestContext, "165165")
|
||||||
tag, err := GetTag(client, requestContext, "165165")
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user