common/pkg/coach-client/client_cn_test.go

25 lines
406 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)
}
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))
}