增加单测和测试文件

This commit is contained in:
2022-07-02 13:43:31 +08:00
parent f80576d8a8
commit 3ac08b5e9e
2 changed files with 37 additions and 6 deletions

View File

@ -10,12 +10,11 @@ package rpc
import (
"encoding/json"
"fmt"
"net/http"
"testing"
)
func TestInitRPC(t *testing.T) {
proxyServiceInfo := &Service{
/*proxyServiceInfo := &Service{
Flag: "goproxy",
Domain: "https://goproxy.cn/",
CodeField: "-",
@ -36,10 +35,8 @@ func TestInitRPC(t *testing.T) {
},
},
ApiRetry: ApiRetry{},
}
if err := InitRPC(map[string]*Service{
"goproxy": proxyServiceInfo,
}, nil); nil != err {
}*/
if err := InitRPCFromCfgDir("/Users/zhangdeman/project/go-project/rpc/etc", nil); nil != err {
panic(err.Error())
}
var result map[string]interface{}