common/pkg/coach-client/client_cn_test.go

26 lines
444 B
Go
Raw Normal View History

2024-06-14 15:26:27 +08:00
package coach_client
import (
"context"
"testing"
)
func TestCNClient(t *testing.T) {
cli, err := CNClient()
if err != nil {
t.Fatal(err)
}
var page, total int
var resp ItemListData
var items []CNItem
for ; page <= total; page++ {
if resp, err = cli.ListItems(context.Background(), page, 50); err != nil {
t.Fatal(err)
}
total = resp.TotalPages
items = append(items, resp.Items...)
}
t.Logf("共%d个", len(items))
}