common/pkg/coach-client/cn_test.go

25 lines
416 B
Go

package coach_client
import (
"context"
"testing"
)
func TestCNClient(t *testing.T) {
cli, err := CNClient(XMac_Coach)
if err != nil {
t.Fatal(err)
}
var page int
var resp ItemListData
var items []CNItem
for ; page < 2; page++ {
if resp, err = cli.ListItems(context.Background(), page, 50); err != nil {
t.Fatal(err)
}
items = append(items, resp.Items...)
}
t.Logf("共%d个", len(items))
}