Skip to content

Commit 71a1f93

Browse files
committed
Added query params to testing for better coverage
1 parent 8430ff6 commit 71a1f93

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

admin_invite_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ func TestAdminInvite(t *testing.T) {
106106
ctx := context.Background()
107107

108108
t.Run("ListAdminInvites", func(t *testing.T) {
109-
adminInvites, err := client.ListAdminInvites(ctx, nil, nil)
109+
110+
limit := 10
111+
after := "after-id"
112+
113+
adminInvites, err := client.ListAdminInvites(ctx, &limit, &after)
110114
checks.NoError(t, err, "ListAdminInvites error")
111115

112116
if len(adminInvites.AdminInvites) != 1 {

admin_usage_test.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,21 @@ func TestAdminUsageCost(t *testing.T) {
6262
ctx := context.Background()
6363

6464
t.Run("GetAdminUsageCost", func(t *testing.T) {
65+
66+
bucketWidth := "1h"
67+
groupBy := "project_id"
68+
projectIDs := []string{"project_1", "project_2"}
69+
limit := 10
70+
page := "page_1"
71+
6572
request := openai.AdminUsageCostRequest{
66-
StartTime: startTime,
73+
StartTime: startTime,
74+
EndTime: &endTime,
75+
BucketWidth: &bucketWidth,
76+
GroupBy: &groupBy,
77+
ProjectIDs: projectIDs,
78+
Limit: &limit,
79+
Page: &page,
6780
}
6881
costResult, err := client.GetAdminUsageCost(ctx, request)
6982
checks.NoError(t, err)

0 commit comments

Comments
 (0)