2022-03-12 18:06:39 +00:00
|
|
|
// package helpers_test
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// import (
|
|
|
|
// "testing"
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// "git.technical.kiwi/go/otfe/misc/helpers"
|
|
|
|
// "git.technical.kiwi/go/otfe/models"
|
|
|
|
// )
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// func TestGetRootDir(t *testing.T) {
|
|
|
|
// t.Log("Root path:", helpers.GetRootDir())
|
|
|
|
// }
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// func TestHashPassword(t *testing.T) {
|
|
|
|
// user := models.User{Email: "a@a.com", Username: "a"}
|
|
|
|
// user.Delete("username", "a")
|
|
|
|
// var err error
|
|
|
|
// password := "43539jgifdkvnm4935078uJKJR**$ufjqd98438uiAHFJean89q34JKDFJ"
|
|
|
|
// user.Password, err = helpers.HashPassword(password)
|
|
|
|
// if err != nil {
|
|
|
|
// t.Fail()
|
|
|
|
// }
|
|
|
|
// user.Create()
|
|
|
|
// var user2 models.User
|
|
|
|
// user2.Read("username", "a")
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// t.Log(helpers.CheckPasswordHash(password, user2.Password))
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// }
|
2022-02-23 12:07:09 +00:00
|
|
|
|
2022-03-12 18:06:39 +00:00
|
|
|
// func TestRandHex(t *testing.T) {
|
|
|
|
// for i := 0; i < 20; i++ {
|
|
|
|
// t.Log(helpers.RandHex())
|
|
|
|
// }
|
|
|
|
// }
|