Repository navigation
Expand file tree
/
Copy pathmodel_test.go
More file actions
65 lines (62 loc) · 1.66 KB
/
Copy pathmodel_test.go
File metadata and controls
65 lines (62 loc) · 1.66 KB
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
58
59
60
61
62
63
64
65
package argus
import "testing"
func TestModelDataGetters(t *testing.T) {
m := &modelData{
IDVal: "test/model",
NameVal: "Test Model",
ProviderVal: "TestProvider",
DeveloperVal: "test",
OfficialURLVal: "https://example.com/model",
ModelCardURLVal: "https://huggingface.co/test/model",
DescVal: "A test model",
DescCNVal: "测试模型",
TagList: []string{"coding", "tool-use"},
ContextLenVal: 100,
MaxOutputVal: 50,
FeaturesVal: ModalityTextIn,
AliasList: []string{"tm"},
}
if m.ID() != "test/model" {
t.Error("Getter ID fail")
}
if m.Name() != "Test Model" {
t.Error("Getter Name fail")
}
if m.Provider() != "TestProvider" {
t.Error("Getter Provider fail")
}
if m.Description() != "A test model" {
t.Error("Getter Description fail")
}
if m.DescriptionCN() != "测试模型" {
t.Error("Getter DescriptionCN fail")
}
if m.Family() != "" {
t.Error("Getter Family default fail")
}
if m.Series() != "" {
t.Error("Getter Series default fail")
}
if m.Summary() != "" {
t.Error("Getter Summary default fail")
}
if m.ContextLength() != 100 {
t.Error("Getter ContextLength fail")
}
if m.MaxOutput() != 50 {
t.Error("Getter MaxOutput fail")
}
if !m.HasCapability(ModalityTextIn) {
t.Error("Getter HasCapability fail")
}
if m.Aliases()[0] != "tm" {
t.Error("Getter Aliases fail")
}
if !m.HasTag("coder") {
t.Error("Getter HasTag fail")
}
card := m.Card()
if card.ID != "test/model" || card.Name != "Test Model" || card.Provider != "TestProvider" || card.Developer != "test" || card.OfficialURL == "" || card.ModelCardURL == "" {
t.Error("Getter Card fail")
}
}