test: tighten model list auth fixtures · openclaw/openclaw@be1037f
shakkernerd
·
2026-04-30
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,6 +11,18 @@ const emptyStore: AuthProfileStore = {
|
11 | 11 | profiles: {}, |
12 | 12 | }; |
13 | 13 | |
| 14 | +function modelConfig(id: string) { |
| 15 | +return { |
| 16 | + id, |
| 17 | +name: id, |
| 18 | +reasoning: false, |
| 19 | +input: ["text" as const], |
| 20 | +cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, |
| 21 | +contextWindow: 8192, |
| 22 | +maxTokens: 4096, |
| 23 | +}; |
| 24 | +} |
| 25 | + |
14 | 26 | describe("createModelListAuthIndex", () => { |
15 | 27 | it("normalizes auth aliases from profiles", () => { |
16 | 28 | const index = createModelListAuthIndex({ |
@@ -54,7 +66,7 @@ describe("createModelListAuthIndex", () => {
|
54 | 66 | api: "openai-completions", |
55 | 67 | apiKey: "sk-configured", |
56 | 68 | baseUrl: "https://custom.example/v1", |
57 | | -models: [{ id: "local-model" }], |
| 69 | +models: [modelConfig("local-model")], |
58 | 70 | }, |
59 | 71 | }, |
60 | 72 | }, |
@@ -74,7 +86,7 @@ describe("createModelListAuthIndex", () => {
|
74 | 86 | "local-openai": { |
75 | 87 | api: "openai-completions", |
76 | 88 | baseUrl: "http://127.0.0.1:8080/v1", |
77 | | -models: [{ id: "local-model" }], |
| 89 | +models: [modelConfig("local-model")], |
78 | 90 | }, |
79 | 91 | }, |
80 | 92 | }, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。