refactor: moved http.Client to model.RequestContext
Signed-off-by: SoXX <soxx@fenpa.ws>
This commit is contained in:
parent
50e8cc24cb
commit
5e8c3509ea
@ -33,14 +33,14 @@ func TestGetPool(t *testing.T) {
|
||||
httpmock.RegisterResponder("GET", "https://e621.net/pools/36957.json", jsonResponser)
|
||||
|
||||
requestContext := model.RequestContext{
|
||||
Client: http.Client{},
|
||||
Host: "https://e621.net",
|
||||
UserAgent: "Go-e621-SDK (@username)",
|
||||
Username: "memo",
|
||||
APIKey: "123456",
|
||||
}
|
||||
|
||||
client := http.Client{}
|
||||
pool, err := GetPool(client, requestContext, "36957")
|
||||
pool, err := GetPool(requestContext, "36957")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
@ -121,14 +121,14 @@ func TestGetPools(t *testing.T) {
|
||||
httpmock.RegisterResponder("GET", "https://e621.net/pools.json", jsonResponser)
|
||||
|
||||
requestContext := model.RequestContext{
|
||||
Client: http.Client{},
|
||||
Host: "https://e621.net",
|
||||
UserAgent: "Go-e621-SDK (@username)",
|
||||
Username: "memo",
|
||||
APIKey: "123456",
|
||||
}
|
||||
|
||||
client := http.Client{}
|
||||
pools, err := GetPools(client, requestContext, map[string]string{})
|
||||
pools, err := GetPools(requestContext, map[string]string{})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user