Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
This commit is contained in:
@@ -4,17 +4,17 @@ import (
|
||||
"testing"
|
||||
|
||||
"gitea.badhouseplants.net/softplayer/softplayer-backend/internal/helpers/hash"
|
||||
"github.com/alecthomas/assert/v2"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestHashValid(t *testing.T) {
|
||||
func TestUnitHashValid(t *testing.T) {
|
||||
password := "qwertyu9"
|
||||
hpass, err := hash.HashPassword(password, 10)
|
||||
assert.NoError(t, err)
|
||||
assert.NoError(t, hash.CheckPasswordHash(password, hpass))
|
||||
}
|
||||
|
||||
func TestHashInvalid(t *testing.T) {
|
||||
func TestUnitHashInvalid(t *testing.T) {
|
||||
password := "qwertyu9"
|
||||
invhash := "qwertyu9"
|
||||
assert.Error(t, hash.CheckPasswordHash(password, invhash))
|
||||
|
||||
Reference in New Issue
Block a user