test: fix missing `isPackage` argument called method

This commit is contained in:
huiyifyj 2025-04-01 16:46:36 +08:00
parent 83eb193f1b
commit 8bec94336b
No known key found for this signature in database
GPG Key ID: 67D4F264AF9D2C4C
1 changed files with 9 additions and 6 deletions

View File

@ -2,10 +2,11 @@ package system
import ( import (
"context" "context"
model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
"github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
"reflect" "reflect"
"testing" "testing"
model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
"github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
) )
func Test_autoCodePackage_Create(t *testing.T) { func Test_autoCodePackage_Create(t *testing.T) {
@ -53,9 +54,10 @@ func Test_autoCodePackage_Create(t *testing.T) {
func Test_autoCodePackage_templates(t *testing.T) { func Test_autoCodePackage_templates(t *testing.T) {
type args struct { type args struct {
ctx context.Context ctx context.Context
entity model.SysAutoCodePackage entity model.SysAutoCodePackage
info request.AutoCode info request.AutoCode
isPackage bool
} }
tests := []struct { tests := []struct {
name string name string
@ -78,6 +80,7 @@ func Test_autoCodePackage_templates(t *testing.T) {
Abbreviation: "user", Abbreviation: "user",
HumpPackageName: "user", HumpPackageName: "user",
}, },
isPackage: false,
}, },
wantErr: false, wantErr: false,
}, },
@ -85,7 +88,7 @@ func Test_autoCodePackage_templates(t *testing.T) {
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
s := &autoCodePackage{} s := &autoCodePackage{}
gotCode, gotEnter, gotCreates, err := s.templates(tt.args.ctx, tt.args.entity, tt.args.info) gotCode, gotEnter, gotCreates, err := s.templates(tt.args.ctx, tt.args.entity, tt.args.info, tt.args.isPackage)
if (err != nil) != tt.wantErr { if (err != nil) != tt.wantErr {
t.Errorf("templates() error = %v, wantErr %v", err, tt.wantErr) t.Errorf("templates() error = %v, wantErr %v", err, tt.wantErr)
return return