MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / TestThinkingE2EMatrix_Suffix

Function TestThinkingE2EMatrix_Suffix

test/thinking_conversion_test.go:44–1098  ·  view source on GitHub ↗

TestThinkingE2EMatrix_Suffix tests the thinking configuration transformation using model name suffix. Data flow: Input JSON → TranslateRequest → ApplyThinking → Validate Output No helper functions are used; all test data is inline.

(t *testing.T)

Source from the content-addressed store, hash-verified

42// Data flow: Input JSON → TranslateRequest → ApplyThinking → Validate Output
43// No helper functions are used; all test data is inline.
44func TestThinkingE2EMatrix_Suffix(t *testing.T) {
45 reg := registry.GetGlobalRegistry()
46 uid := fmt.Sprintf("thinking-e2e-suffix-%d", time.Now().UnixNano())
47
48 reg.RegisterClient(uid, "test", getTestModels())
49 defer reg.UnregisterClient(uid)
50
51 cases := []thinkingTestCase{
52 // level-model (Levels=minimal/low/medium/high, ZeroAllowed=false, DynamicAllowed=false)
53
54 // Case 1: No suffix → injected default → medium
55 {
56 name: "1",
57 from: "openai",
58 to: "codex",
59 model: "level-model",
60 inputJSON: `{"model":"level-model","messages":[{"role":"user","content":"hi"}]}`,
61 expectField: "reasoning.effort",
62 expectValue: "medium",
63 expectErr: false,
64 },
65 // Case 2: Specified medium → medium
66 {
67 name: "2",
68 from: "openai",
69 to: "codex",
70 model: "level-model(medium)",
71 inputJSON: `{"model":"level-model(medium)","messages":[{"role":"user","content":"hi"}]}`,
72 expectField: "reasoning.effort",
73 expectValue: "medium",
74 expectErr: false,
75 },
76 // Case 3: Specified xhigh → out of range error
77 {
78 name: "3",
79 from: "openai",
80 to: "codex",
81 model: "level-model(xhigh)",
82 inputJSON: `{"model":"level-model(xhigh)","messages":[{"role":"user","content":"hi"}]}`,
83 expectField: "",
84 expectErr: true,
85 },
86 // Case 4: Level none → clamped to minimal (ZeroAllowed=false)
87 {
88 name: "4",
89 from: "openai",
90 to: "codex",
91 model: "level-model(none)",
92 inputJSON: `{"model":"level-model(none)","messages":[{"role":"user","content":"hi"}]}`,
93 expectField: "reasoning.effort",
94 expectValue: "minimal",
95 expectErr: false,
96 },
97 // Case 5: Level auto → DynamicAllowed=false → medium (mid-range)
98 {
99 name: "5",
100 from: "openai",
101 to: "codex",

Callers

nothing calls this directly

Calls 5

GetGlobalRegistryFunction · 0.92
getTestModelsFunction · 0.85
runThinkingTestsFunction · 0.85
RegisterClientMethod · 0.65
UnregisterClientMethod · 0.65

Tested by

no test coverage detected