-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathmodels_test.go
46 lines (38 loc) · 1.14 KB
/
models_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
package deepseek_test
import (
"context"
"testing"
"github.com/cohesion-org/deepseek-go"
"github.com/cohesion-org/deepseek-go/internal/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestListAllModels(t *testing.T) {
testutil.SkipIfShort(t)
config := testutil.LoadTestConfig(t)
client := deepseek.NewClient(config.APIKey)
ctx, cancel := context.WithTimeout(context.Background(), config.TestTimeout)
defer cancel()
resp, err := deepseek.ListAllModels(client, ctx)
require.NoError(t, err)
assert.NotNil(t, resp)
// Verify response structure
assert.Equal(t, "list", resp.Object)
assert.NotEmpty(t, resp.Data)
// Verify model details
for _, model := range resp.Data {
assert.NotEmpty(t, model.ID)
assert.Equal(t, "model", model.Object)
assert.Equal(t, "deepseek", model.OwnedBy)
// Verify known models exist in constants.go
if model.ID == deepseek.DeepSeekChat ||
model.ID == deepseek.DeepSeekCoder ||
model.ID == deepseek.DeepSeekReasoner {
assert.Contains(t, []string{
deepseek.DeepSeekChat,
deepseek.DeepSeekCoder,
deepseek.DeepSeekReasoner,
}, model.ID)
}
}
}