History

fix(test): rename test function to reflect behavior change for builtin tools

hkfires committed 9 months ago

Commit 075e3ab1 parent c1c94831 file · +3 −9Browse files

Unified · Split

test/builtin_tools_translation_test.go+3−9
@@ -33,7 +33,7 @@ func TestOpenAIToCodex_PreservesBuiltinTools(t *testing.T) { · 32 unmodified lines
3333 }
3434 }
3535
36−func TestOpenAIResponsesToOpenAI_PreservesBuiltinTools(t *testing.T) {
36+func TestOpenAIResponsesToOpenAI_IgnoresBuiltinTools(t *testing.T) {
3737 in := []byte(`{
3838 "model":"gpt-5",
3939 "input":[{"role":"user","content":[{"type":"input_text","text":"hi"}]}],
@@ -42,13 +42,7 @@ func TestOpenAIResponsesToOpenAI_PreservesBuiltinTools(t *testing.T) { · 2 unmodified lines
4242
4343 out := sdktranslator.TranslateRequest(sdktranslator.FormatOpenAIResponse, sdktranslator.FormatOpenAI, "gpt-5", in, false)
4444
45− if got := gjson.GetBytes(out, "tools.#").Int(); got != 1 {
46− t.Fatalf("expected 1 tool, got %d: %s", got, string(out))
47− }
48− if got := gjson.GetBytes(out, "tools.0.type").String(); got != "web_search" {
49− t.Fatalf("expected tools[0].type=web_search, got %q: %s", got, string(out))
50− }
51− if got := gjson.GetBytes(out, "tools.0.search_context_size").String(); got != "low" {
52− t.Fatalf("expected tools[0].search_context_size=low, got %q: %s", got, string(out))
45+ if got := gjson.GetBytes(out, "tools.#").Int(); got != 0 {
46+ t.Fatalf("expected 0 tools (builtin tools not supported in Chat Completions), got %d: %s", got, string(out))
5347 }
5448 }