You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1003 B
Go
58 lines
1003 B
Go
package campaignstat
|
|
|
|
import (
|
|
"context"
|
|
"joybuywork/internal/config"
|
|
"joybuywork/internal/consts"
|
|
"joybuywork/internal/server/depend"
|
|
pb "joybuywork/proto/go_proto/w_campaign_stat"
|
|
_ "joybuywork/test"
|
|
"gits.branchcn.com/backend/microcode/micro"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestReportInfo(t *testing.T) {
|
|
res := &pb.ReportInfoRes{}
|
|
|
|
container := new(ReportInfo)
|
|
{
|
|
container.Init(context.Background())
|
|
container.Req = &pb.ReportInfoReq{
|
|
HashId: "crlsa3urdj7ivpdso7ag",
|
|
}
|
|
container.Res = res
|
|
}
|
|
|
|
t.Log(container.Run())
|
|
|
|
t.Log(res)
|
|
}
|
|
|
|
func TestUserCycle(t *testing.T) {
|
|
rpc()
|
|
res := &pb.UserCycleRes{}
|
|
|
|
container := new(UserCycle)
|
|
{
|
|
container.Init(context.Background())
|
|
container.Req = &pb.UserCycleReq{
|
|
CampaignHashId: "cs2aqpmrdj7vlqngmp8g",
|
|
}
|
|
container.Res = res
|
|
}
|
|
|
|
t.Log(container.Run())
|
|
|
|
t.Log(res)
|
|
}
|
|
|
|
func rpc() {
|
|
os.Args = []string{}
|
|
|
|
depend.M = micro.Grpc(micro.GrpcConfig{
|
|
ServerName: consts.ServiceName,
|
|
EtcdAddress: config.Config.Etcd.Address,
|
|
})
|
|
}
|