-
Notifications
You must be signed in to change notification settings - Fork 36
/
finetune_test.go
57 lines (49 loc) · 1.58 KB
/
finetune_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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package openaigo
import (
"testing"
. "github.com/otiai10/mint"
)
func TestClient_CreateFineTune(t *testing.T) {
client := NewClient("")
client.BaseURL = mockserver.URL
res, err := client.CreateFineTune(nil, FineTuneCreateRequestBody{
TrainingFile: "file-XGinujblHPwGLSztz8cPS8XY",
})
Expect(t, err).ToBe(nil)
Expect(t, res).TypeOf("openaigo.FineTuneCreateResponse")
}
func TestClient_ListFineTunes(t *testing.T) {
client := NewClient("")
client.BaseURL = mockserver.URL
res, err := client.ListFineTunes(nil)
Expect(t, err).ToBe(nil)
Expect(t, res).TypeOf("openaigo.FineTuneListResponse")
}
func TestClient_RetrieveFineTune(t *testing.T) {
client := NewClient("")
client.BaseURL = mockserver.URL
res, err := client.RetrieveFineTune(nil, "abcdefghi")
Expect(t, err).ToBe(nil)
Expect(t, res).TypeOf("openaigo.FineTuneRetrieveResponse")
}
func TestClient_CancelFineTune(t *testing.T) {
client := NewClient("")
client.BaseURL = mockserver.URL
res, err := client.CancelFineTune(nil, "abcdefghi")
Expect(t, err).ToBe(nil)
Expect(t, res).TypeOf("openaigo.FineTuneCancelResponse")
}
func TestClient_ListFineTuneEvents(t *testing.T) {
client := NewClient("")
client.BaseURL = mockserver.URL
res, err := client.ListFineTuneEvents(nil, "abcdefghi")
Expect(t, err).ToBe(nil)
Expect(t, res).TypeOf("openaigo.FineTuneListEventsResponse")
}
func TestClient_DeleteFineTune(t *testing.T) {
client := NewClient("")
client.BaseURL = mockserver.URL
res, err := client.DeleteFineTuneModel(nil, "abcdefg")
Expect(t, err).ToBe(nil)
Expect(t, res).TypeOf("openaigo.FineTuneDeleteModelResponse")
}