-
Notifications
You must be signed in to change notification settings - Fork 36
/
finetuning_test.go
42 lines (36 loc) · 1.15 KB
/
finetuning_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package openaigo
import (
"context"
"testing"
. "github.com/otiai10/mint"
)
func TestClient_CreateFineTuning(t *testing.T) {
client := NewClient("")
client.BaseURL = mockserver.URL
res, err := client.CreateFineTuning(context.TODO(), FineTuningCreateRequestBody{
TrainingFile: "file-XGinujblHPwGLSztz8cPS8XY",
})
Expect(t, err).ToBe(nil)
Expect(t, res).TypeOf("openaigo.FineTuningJob")
}
func TestClient_RetrieveFineTuning(t *testing.T) {
client := NewClient("")
client.BaseURL = mockserver.URL
res, err := client.RetrieveFineTuning(context.TODO(), "abcdefghi")
Expect(t, err).ToBe(nil)
Expect(t, res).TypeOf("openaigo.FineTuningJob")
}
func TestClient_CancelFineTuning(t *testing.T) {
client := NewClient("")
client.BaseURL = mockserver.URL
res, err := client.CancelFineTuning(context.TODO(), "abcdefghi")
Expect(t, err).ToBe(nil)
Expect(t, res).TypeOf("openaigo.FineTuningJob")
}
func TestClient_ListFineTuningEvents(t *testing.T) {
client := NewClient("")
client.BaseURL = mockserver.URL
res, err := client.ListFineTuningEvents(context.TODO(), "abcdefghi")
Expect(t, err).ToBe(nil)
Expect(t, res).TypeOf("openaigo.FineTuningListEventsResponse")
}