@@ -119,7 +119,7 @@ func (s *UserSuite) Test_DeleteUserByID() {
119
119
120
120
func (s * UserSuite ) Test_CreateUser () {
121
121
pwByte := []byte {1 , 2 , 3 }
122
- patch := monkey .Patch (auth .CreatePassword , func (pw string ) []byte {
122
+ patch := monkey .Patch (auth .CreatePassword , func (pw string , strength int ) []byte {
123
123
if pw == "mylittlepony" {
124
124
return pwByte
125
125
}
@@ -160,7 +160,7 @@ func (s *UserSuite) Test_CreateUser_NoName() {
160
160
161
161
func (s * UserSuite ) Test_CreateUser_NameAlreadyExists () {
162
162
pwByte := []byte {1 , 2 , 3 }
163
- monkey .Patch (auth .CreatePassword , func (pw string ) []byte { return pwByte })
163
+ monkey .Patch (auth .CreatePassword , func (pw string , strength int ) []byte { return pwByte })
164
164
165
165
s .db .On ("GetUserByName" , "tom" ).Return (& model.User {ID : 3 , Name : "tom" })
166
166
@@ -215,7 +215,7 @@ func (s *UserSuite) Test_UpdateUserByID_UpdateNotPassword() {
215
215
216
216
func (s * UserSuite ) Test_UpdateUserByID_UpdatePassword () {
217
217
pwByte := []byte {1 , 2 , 3 }
218
- patch := monkey .Patch (auth .CreatePassword , func (pw string ) []byte { return pwByte })
218
+ patch := monkey .Patch (auth .CreatePassword , func (pw string , strength int ) []byte { return pwByte })
219
219
defer patch .Unpatch ()
220
220
221
221
s .db .On ("GetUserByID" , uint (2 )).Return (normalUser )
@@ -236,7 +236,7 @@ func (s *UserSuite) Test_UpdateUserByID_UpdatePassword() {
236
236
237
237
func (s * UserSuite ) Test_UpdatePassword () {
238
238
pwByte := []byte {1 , 2 , 3 }
239
- createPasswordPatch := monkey .Patch (auth .CreatePassword , func (pw string ) []byte { return pwByte })
239
+ createPasswordPatch := monkey .Patch (auth .CreatePassword , func (pw string , strength int ) []byte { return pwByte })
240
240
defer createPasswordPatch .Unpatch ()
241
241
patchUser := monkey .Patch (auth .GetUserID , func (* gin.Context ) uint { return 1 })
242
242
defer patchUser .Unpatch ()
0 commit comments