test: clean up reward-hacking backend tests (#5563)

This commit is contained in:
Seefs
2026-06-17 16:47:52 +08:00
committed by GitHub
parent b798e3496f
commit 8d87d5fd8b
11 changed files with 56 additions and 485 deletions
@@ -81,10 +81,6 @@ func TestCollectPendingApplyUpstreamModelChanges(t *testing.T) {
require.Equal(t, []string{"old-model"}, pendingRemoveModels)
}
func TestChannelUpstreamModelUpdateSelectFieldsIncludeModelMapping(t *testing.T) {
require.Contains(t, channelUpstreamModelUpdateSelectFields, "model_mapping")
}
func TestNormalizeChannelModelMapping(t *testing.T) {
modelMapping := `{
" alias-model ": " upstream-model ",
+2
View File
@@ -220,10 +220,12 @@ func TestListModelsTokenLimitIncludesTieredBillingModel(t *testing.T) {
"zz-token-tiered-visible-model": `tier("base", p * 1 + c * 2)`,
"zz-token-tiered-empty-expr-model": "",
})
setupModelListControllerTestDB(t)
recorder := httptest.NewRecorder()
ctx, _ := gin.CreateTestContext(recorder)
ctx.Request = httptest.NewRequest(http.MethodGet, "/v1/models", nil)
common.SetContextKey(ctx, constant.ContextKeyUserGroup, "default")
common.SetContextKey(ctx, constant.ContextKeyTokenModelLimitEnabled, true)
common.SetContextKey(ctx, constant.ContextKeyTokenModelLimit, map[string]bool{
"zz-token-tiered-visible-model": true,