mirror of
https://codeberg.org/VnPower/PixivFE
synced 2024-12-06 19:16:23 +01:00
Test files #13
This commit is contained in:
+2
-1
@@ -4,4 +4,5 @@ steps:
|
||||
commands:
|
||||
- go get
|
||||
- go build
|
||||
- go test -v "handler/*"
|
||||
- go test -v
|
||||
secrets: [pixivfe_token]
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
package handler
|
||||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"os"
|
||||
"pixivfe/handler"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func generate_test_client() *PixivClient {
|
||||
func generate_test_client() *handler.PixivClient {
|
||||
transport := &http.Transport{Proxy: http.ProxyFromEnvironment}
|
||||
client := &http.Client{
|
||||
Timeout: time.Duration(5000) * time.Millisecond,
|
||||
Transport: transport,
|
||||
}
|
||||
|
||||
pc := &PixivClient{
|
||||
pc := &handler.PixivClient{
|
||||
Client: client,
|
||||
Header: make(map[string]string),
|
||||
Cookie: make(map[string]string),
|
||||
Reference in New Issue
Block a user