Skip to content

Commit

Permalink
fix: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Malyue committed Dec 19, 2023
1 parent 43348ae commit 1547977
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/core/legacy/services/audit/audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package audit
import (
"context"
"fmt"
"github.com/erda-project/erda/internal/core/legacy/common/ctxhelper"
"reflect"
"testing"

Expand Down Expand Up @@ -249,13 +250,14 @@ func Test_constructFilterParamByReq(t *testing.T) {

for _, tt := range testcase {
t.Run(tt.Name, func(t *testing.T) {
ctx := context.WithValue(context.Background(), "lang_codes", i18n.LanguageCodes{})
//ctx := context.WithValue(context.Background(), "lang_codes", i18n.LanguageCodes{})
ctx := ctxhelper.PutAuditLanguage(context.Background(), i18n.LanguageCodes{})
filterParam, err := audit.constructFilterParamByReq(ctx, tt.param)
assert.Equal(t, filterParam, tt.want.filterParam)
if err != nil {
assert.Equal(t, err.Error(), tt.want.err.Error())
assert.Equal(t, tt.want.err.Error(), err.Error())
} else {
assert.Equal(t, err, tt.want.err)
assert.Equal(t, tt.want.err, err)
}
})
}
Expand Down

0 comments on commit 1547977

Please sign in to comment.