github.com/xxf098/lite-proxy@v0.15.1-0.20230422081941-12c69f323218/api/rpc/liteclient/client_test.go (about)

     1  package liteclient
     2  
     3  import (
     4  	"testing"
     5  
     6  	pb "github.com/xxf098/lite-proxy/api/rpc/lite"
     7  	s "github.com/xxf098/lite-proxy/api/rpc/liteserver"
     8  )
     9  
    10  func TestStartClient(t *testing.T) {
    11  	go s.StartServer(10999)
    12  	req := pb.TestRequest{
    13  		GroupName:     "Default",
    14  		SpeedTestMode: pb.SpeedTestMode_all,
    15  		PingMethod:    pb.PingMethod_googleping,
    16  		SortMethod:    pb.SortMethod_rspeed,
    17  		Concurrency:   2,
    18  		TestMode:      2,
    19  		Subscription:  "https://raw.githubusercontent.com/freefq/free/master/v2",
    20  		Language:      "en",
    21  		FontSize:      24,
    22  		Theme:         "rainbow",
    23  		Timeout:       10,
    24  		OutputMode:    0,
    25  	}
    26  	reply, err := StartClient("127.0.0.1:10999", &req)
    27  	if err != nil {
    28  		t.Fatal(err)
    29  	}
    30  	if len(reply) < 1 {
    31  		t.Fail()
    32  	}
    33  }