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

Function TestThinkingE2EMatrix_Body

test/thinking_conversion_test.go:1102–2189  ·  view source on GitHub ↗

TestThinkingE2EMatrix_Body tests the thinking configuration transformation using request body parameters. Data flow: Input JSON with thinking params → TranslateRequest → ApplyThinking → Validate Output

(t *testing.T)

Source from the content-addressed store, hash-verified

1100// TestThinkingE2EMatrix_Body tests the thinking configuration transformation using request body parameters.
1101// Data flow: Input JSON with thinking params → TranslateRequest → ApplyThinking → Validate Output
1102func TestThinkingE2EMatrix_Body(t *testing.T) {
1103 reg := registry.GetGlobalRegistry()
1104 uid := fmt.Sprintf("thinking-e2e-body-%d", time.Now().UnixNano())
1105
1106 reg.RegisterClient(uid, "test", getTestModels())
1107 defer reg.UnregisterClient(uid)
1108
1109 cases := []thinkingTestCase{
1110 // level-model (Levels=minimal/low/medium/high, ZeroAllowed=false, DynamicAllowed=false)
1111
1112 // Case 1: No param → injected default → medium
1113 {
1114 name: "1",
1115 from: "openai",
1116 to: "codex",
1117 model: "level-model",
1118 inputJSON: `{"model":"level-model","messages":[{"role":"user","content":"hi"}]}`,
1119 expectField: "reasoning.effort",
1120 expectValue: "medium",
1121 expectErr: false,
1122 },
1123 // Case 2: reasoning_effort=medium → medium
1124 {
1125 name: "2",
1126 from: "openai",
1127 to: "codex",
1128 model: "level-model",
1129 inputJSON: `{"model":"level-model","messages":[{"role":"user","content":"hi"}],"reasoning_effort":"medium"}`,
1130 expectField: "reasoning.effort",
1131 expectValue: "medium",
1132 expectErr: false,
1133 },
1134 // Case 3: reasoning_effort=xhigh → out of range error
1135 {
1136 name: "3",
1137 from: "openai",
1138 to: "codex",
1139 model: "level-model",
1140 inputJSON: `{"model":"level-model","messages":[{"role":"user","content":"hi"}],"reasoning_effort":"xhigh"}`,
1141 expectField: "",
1142 expectErr: true,
1143 },
1144 // Case 4: reasoning_effort=none → clamped to minimal
1145 {
1146 name: "4",
1147 from: "openai",
1148 to: "codex",
1149 model: "level-model",
1150 inputJSON: `{"model":"level-model","messages":[{"role":"user","content":"hi"}],"reasoning_effort":"none"}`,
1151 expectField: "reasoning.effort",
1152 expectValue: "minimal",
1153 expectErr: false,
1154 },
1155 // Case 5: reasoning_effort=auto → medium (DynamicAllowed=false)
1156 {
1157 name: "5",
1158 from: "openai",
1159 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