mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-19 04:40:52 +08:00
Implement test for user field deletion
Add test to verify deletion of user field in response
This commit is contained in:
@@ -263,3 +263,20 @@ func TestConvertSystemRoleToDeveloper_AssistantRole(t *testing.T) {
|
|||||||
t.Errorf("Expected third role 'assistant', got '%s'", thirdRole.String())
|
t.Errorf("Expected third role 'assistant', got '%s'", thirdRole.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestUserFieldDeletion(t *testing.T) {
|
||||||
|
inputJSON := []byte(`{
|
||||||
|
"model": "gpt-5.2",
|
||||||
|
"user": "test-user",
|
||||||
|
"input": [{"role": "user", "content": "Hello"}]
|
||||||
|
}`)
|
||||||
|
|
||||||
|
output := ConvertOpenAIResponsesRequestToCodex("gpt-5.2", inputJSON, false)
|
||||||
|
outputStr := string(output)
|
||||||
|
|
||||||
|
// Verify user field is deleted
|
||||||
|
userField := gjson.Get(outputStr, "user")
|
||||||
|
if userField.Exists() {
|
||||||
|
t.Error("user field should be deleted")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user