common/pkg/coach-client/cn_test.go

25 lines
416 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) {
2024-11-20 21:11:19 +08:00
cli, err := CNClient(XMac_Coach)
2024-06-14 15:26:27 +08:00
if err != nil {
t.Fatal(err)
}
2024-06-14 17:42:07 +08:00
var page int
2024-06-14 15:26:27 +08:00
var resp ItemListData
var items []CNItem
2024-06-14 17:42:07 +08:00
for ; page < 2; page++ {
2024-06-14 15:26:27 +08:00
if resp, err = cli.ListItems(context.Background(), page, 50); err != nil {
t.Fatal(err)
}
items = append(items, resp.Items...)
}
t.Logf("共%d个", len(items))
}